From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#56025: 29.0.50; em-extpipe-test-2 times out on EMBA and Cygwin Date: Wed, 6 Jul 2022 21:35:36 -0700 Message-ID: <19c66901-2eeb-1f40-17a4-4ed54827e065@gmail.com> References: <8e21db9c-0100-998e-f280-81304e7ff61a@cornell.edu> <7e7daa2f-dbbc-cd0a-4958-2a2932b17837@gmail.com> <8974408d-91cd-aebd-7a5b-596a57bd640e@cornell.edu> <17d41105-b006-f9ad-af0b-ece84a7f5248@gmail.com> <040b3a36-459b-a94d-f879-7f45aac50bda@cornell.edu> <83sfnud26o.fsf@gnu.org> <96e47ba7-efaa-b6df-dd98-60f09068e68c@gmail.com> <874k097lbh.fsf@melete.silentflame.com> <8735frmjrr.fsf@athena.silentflame.com> <4676f52c-4758-38df-f0f4-dbcb5d848c1b@gmail.com> <8735fr2kq6.fsf@melete.silentflame.com> <10cf6a90-f86a-b0df-4dc2-c258b7494158@gmail.com> <18e79c02-3a2a-77d1-3798-33711f52d6b9@cornell.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32464"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 56025@debbugs.gnu.org To: Ken Brown , Sean Whitton , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 07 06:36:11 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o9JFK-0008HB-9e for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Jul 2022 06:36:10 +0200 Original-Received: from localhost ([::1]:37462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o9JFI-0005Th-P0 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Jul 2022 00:36:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9JFB-0005Se-W9 for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2022 00:36:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33349) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o9JFB-0004sE-NA for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2022 00:36:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o9JFB-0003Wl-LW for bug-gnu-emacs@gnu.org; Thu, 07 Jul 2022 00:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Jul 2022 04:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56025 X-GNU-PR-Package: emacs Original-Received: via spool by 56025-submit@debbugs.gnu.org id=B56025.165716854613535 (code B ref 56025); Thu, 07 Jul 2022 04:36:01 +0000 Original-Received: (at 56025) by debbugs.gnu.org; 7 Jul 2022 04:35:46 +0000 Original-Received: from localhost ([127.0.0.1]:55479 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9JEv-0003WF-LF for submit@debbugs.gnu.org; Thu, 07 Jul 2022 00:35:45 -0400 Original-Received: from mail-pg1-f180.google.com ([209.85.215.180]:40479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9JEu-0003W1-83 for 56025@debbugs.gnu.org; Thu, 07 Jul 2022 00:35:44 -0400 Original-Received: by mail-pg1-f180.google.com with SMTP id i190so3724268pge.7 for <56025@debbugs.gnu.org>; Wed, 06 Jul 2022 21:35:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=AjJhP5PEbUZmDGb0Gc4OCvDY9i88LxjvHBuUECLw9QI=; b=XD6tNfzldxq0YbMYfm/yx3kVRHoBANarBkyK57j10XB6uGrWSDV/prfmzLrSWIOT7X CL3douZUInNbRviNIQYhCgoKJkbwOEbMrqVpP4DaRg+qRL1wXmD4uymDFHjaP971FmwU KWWKpSbufyG47M9vcZSo3jy//TOc9HrnBM3DCYbVxhY84vYokhj/6nt8ri2N+VrRiGRn GUFwRzXhav8RU0+dW2wPJhR+v8eeRssflXYbPi1X/RwLG02tm+AVbwQJ90BSVLagB35E sP4zAVjgqNvwZlfPzwXWrD0tbb2boLsB8iQqUPO24NKVonHc6G6KpWtKoszcBRY7v/2t oB+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=AjJhP5PEbUZmDGb0Gc4OCvDY9i88LxjvHBuUECLw9QI=; b=kaEixkPiFHZXKZ8Slyb8+HQcMBaE5h4l5aHvq1kKRPJpLlHtknzJZCk6/ba5FFLCQu sPISf78n812htnETnHSDGRZKjNncSTa8017vqWViVuArInH1xhb/WK40L7YwJL/Dytkf wmZ7dE4q5118yJNXMlP/GW0DzOR8dOix1o+PeK3vnDIW4QEs/4LQz/9Id73kG6/nhxYD wz7pZDZSE8lhXmV0z2Eu/NoeyCvd5UVkLXee9qKV2tphheuSk+SkTjlE2cpJx2+FrTav vuKKrkmwaKs1+u55+t+3UuqdWTcbfLAmobzZbz4jEofaQzLztrS+LYO/xWrs9FyJWCTf 0iGA== X-Gm-Message-State: AJIora9sEdMUNIzjZI+XOaoNB83Jz4nG7DxqeKffiSpfANEC2ZBCK2fQ T4lEpQsV/idxQZwJleGk49GBaLqv90c= X-Google-Smtp-Source: AGRyM1uYqx0DR6DczyK47vjIxeLsFvRMrFEz/8LA+vGnm9m6DvpRtf8I3RTZ7a1uQBxE6zGQ9IQTLA== X-Received: by 2002:a17:902:f805:b0:16b:e0d6:b474 with SMTP id ix5-20020a170902f80500b0016be0d6b474mr21972163plb.165.1657168538101; Wed, 06 Jul 2022 21:35:38 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id y18-20020a17090322d200b0016bdc98730bsm8892891plg.151.2022.07.06.21.35.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Jul 2022 21:35:37 -0700 (PDT) In-Reply-To: <18e79c02-3a2a-77d1-3798-33711f52d6b9@cornell.edu> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:236312 Archived-At: On 7/6/2022 3:33 PM, Ken Brown wrote: > On 6/30/2022 11:52 PM, Jim Porter wrote: >> 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. Yeah, I think that's fine, and the change to send an extra EOF for compatibility with (non-master) Cygwin and Solaris makes sense to me. I just wanted to be sure to mention that I could see the issue too so that I can (hopefully) verify that it's fixed if/when we come up with a more-reliable fix. >> 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. Maybe it would be good to do it this way in general though, since this would let us completely avoid the behavioral differences of EOF on various platforms. I believe using a pipe should work consistently everywhere, right? (It would also probably fix some other issues with Eshell pipelines, but I'll need to read up on ptys, since it's been a long time since I've done anything with them.) >> 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. Yeah, that's what it seems like to me too. I'm not able to reproduce this on GNU/Linux (at least not yet; I'll try some more things out). I'll keep poking at the Cygwin version too, and start experimenting with Emacs's src/process.c to try and allow using a pty for only stdin *or* stdout (instead of both). I think that would make Eshell's pipelines behaves more like other shells, which would squash a lot of bugs in this area.