unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: Jim Porter <jporterbugs@gmail.com>,
	Sean Whitton <spwhitton@email.arizona.edu>,
	Eli Zaretskii <eliz@gnu.org>
Cc: larsi@gnus.org, 56025@debbugs.gnu.org
Subject: bug#56025: 29.0.50; em-extpipe-test-2 times out on EMBA and Cygwin
Date: Wed, 6 Jul 2022 18:33:45 -0400	[thread overview]
Message-ID: <18e79c02-3a2a-77d1-3798-33711f52d6b9@cornell.edu> (raw)
In-Reply-To: <10cf6a90-f86a-b0df-4dc2-c258b7494158@gmail.com>

On 6/30/2022 11:52 PM, Jim Porter wrote:
> On 6/27/2022 2:19 PM, Ken Brown wrote:
>> On 6/27/2022 3:18 PM, Jim Porter wrote:
>>> I'd be very hesitant to do this, since as you mention above, this seems like 
>>> a timing issue, and it's entirely possible that there are other, more 
>>> widespread issues on Cygwin here. We'd also want to check the system that the 
>>> process is actually running on; otherwise, remoting into a Cygwin system (via 
>>> Tramp) would still exhibit the problem. I'll see if I can get a Cygwin 
>>> environment up to test things out in the next week-ish.
>>
>> OK, thanks.  Let me know if you need any help with that.
> 
> Ok, I've got Cygwin set up (though I'm just using the prebuilt Cygwin Emacs for 
> now). I can confirm that the following hangs until I send another EOF via `C-c 
> C-d':
> 
>    echo hi | rev

Yes, but that's because of the behavior of certain platforms (e.g., Cygwin and 
Solaris) with respect to EOF, as I said in an earlier message.  We've changed 
that for Cygwin, so that Cygwin now behaves the same as GNU/Linux, but the 
change won't take effect until Cygwin 3.4.0 is released.  In any case, that 
issue has already been fixed on the master branch.

Aside from that issue, I never had an issue with

   echo hi | rev

but only with

   echo hi | sh -c rev

I have no idea why that should be different.

> However, if I evaluate the following first, the above command works just fine:
> 
>    (add-to-list 'eshell-needs-pipe "rev")
> 
> Normally, Eshell starts each process using ptys to control them. However, the 
> above Elisp code tells Eshell to use a pipe for "rev"[1].

That makes sense.  You're no longer relying on Eshell sending EOF to rev, but 
rather you're letting rev discover EOF because no process holds the pipe open 
for writing, forcing any pending read to stop blocking.

And, for the same reason, evaluating

   (add-to-list 'eshell-needs-pipe "sh")

solves the problem with "echo hi | sh -c rev".

> I'm not totally clear 
> on all the subtleties here, but it seems to me that it would make more sense for 
> rev to use a pipe for its stdin and a pty for its stdout. That's not possible 
> with subprocesses in Emacs though (as far as I know).
> 
> However, I don't think this fully answers things, since I also see inconsistent 
> results if I run "echo hi | rev" a bunch of times. Sometimes it prints "ih" and 
> then I need to hit `C-c C-d` once to stop it. Other times it doesn't print 
> anything and I need to hit `C-c C-d' twice.

Interesting.  I've never seen that.  It's as though "rev" just didn't get one of 
the EOFs.

> There must be some kind of race 
> condition, maybe in Emacs's src/process.c?

I'll poke around, but I'm no expert on how this all works.

Ken





  parent reply	other threads:[~2022-07-06 22:33 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-16 18:30 bug#56025: 29.0.50; em-extpipe-test-2 times out on EMBA and Cygwin Ken Brown
2022-06-16 19:30 ` Sean Whitton
2022-06-16 22:01   ` Ken Brown
2022-06-17 13:39     ` Ken Brown
2022-06-18  0:57       ` Sean Whitton
2022-06-18  2:07         ` Ken Brown
2022-06-18  2:35           ` Ken Brown
2022-06-18  3:50           ` Jim Porter
2022-06-18 17:52             ` Ken Brown
2022-06-18 19:02               ` Jim Porter
2022-06-18 20:51                 ` Ken Brown
2022-06-18 22:00                   ` Jim Porter
2022-06-18 23:46                     ` Sean Whitton
2022-06-19 16:02                     ` Ken Brown
2022-06-24  1:18                       ` Ken Brown
2022-06-24  4:40                         ` Sean Whitton
2022-06-24  6:07                         ` Eli Zaretskii
2022-06-24 16:53                           ` Jim Porter
2022-06-24 22:23                             ` Sean Whitton
2022-06-24 23:03                               ` Jim Porter
2022-06-25  5:34                                 ` Eli Zaretskii
2022-06-25 16:13                                   ` Jim Porter
2022-06-25 16:53                                     ` Eli Zaretskii
2022-06-26 16:27                                       ` Lars Ingebrigtsen
2022-06-26 17:12                                 ` Sean Whitton
2022-06-26 17:22                                   ` Jim Porter
2022-06-26 21:11                                     ` Sean Whitton
2022-06-27 13:25                                       ` Ken Brown
2022-06-27 15:51                                         ` Michael Albinus
2022-06-27 16:22                                           ` Ken Brown
2022-06-27 19:13                                             ` bug#56025: [EXT]Re: " Sean Whitton
2022-06-27 21:17                                               ` Ken Brown
2022-06-27 19:18                                         ` Jim Porter
2022-06-27 21:19                                           ` Ken Brown
2022-07-01  3:52                                             ` Jim Porter
2022-07-01  3:58                                               ` Jim Porter
2022-07-06 22:33                                               ` Ken Brown [this message]
2022-07-07  4:35                                                 ` Jim Porter
2022-07-07  4:42                                                   ` Jim Porter
2022-07-07 12:42                                                     ` Ken Brown
2022-07-17  2:35                                                       ` bug#56025: [WIP PATCH] " Jim Porter
2022-07-17  6:03                                                         ` Eli Zaretskii
2022-07-17 17:44                                                           ` Jim Porter
2022-07-17 18:26                                                             ` Eli Zaretskii
2022-07-17 18:51                                                               ` Jim Porter
2022-07-18  8:09                                                             ` Michael Albinus
2022-07-19  1:58                                                               ` Jim Porter
2022-07-19  7:59                                                                 ` Michael Albinus
2022-07-17 21:59                                                         ` Ken Brown
2022-07-18  5:26                                                           ` Jim Porter
2022-07-22  4:16                                                             ` bug#56025: [PATCH v2] " Jim Porter
2022-07-22 19:00                                                               ` Ken Brown
2022-07-24  4:05                                                                 ` Jim Porter
2022-07-24  5:19                                                                   ` bug#56025: [PATCH v3] " Jim Porter
2022-07-24  5:29                                                                     ` bug#56025: [PATCH v4] " Jim Porter
2022-07-24  9:08                                                                       ` Lars Ingebrigtsen
2022-07-24  9:48                                                                         ` Eli Zaretskii
2022-07-24 21:04                                                                         ` Ken Brown
2022-07-24  9:47                                                                       ` Eli Zaretskii
2022-07-24 17:36                                                                         ` bug#56025: [PATCH v5] " Jim Porter
2022-07-24 20:30                                                                           ` Ken Brown
2022-07-31  1:01                                                                             ` Jim Porter
2022-08-06  1:10                                                                               ` Jim Porter
2022-08-06 12:17                                                                                 ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18e79c02-3a2a-77d1-3798-33711f52d6b9@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=56025@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=jporterbugs@gmail.com \
    --cc=larsi@gnus.org \
    --cc=spwhitton@email.arizona.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).