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: Mon, 27 Jun 2022 12:18:05 -0700 Message-ID: References: <8e21db9c-0100-998e-f280-81304e7ff61a@cornell.edu> <87mtecl82o.fsf@athena.silentflame.com> <40d9e52f-2041-b341-ff77-546ca7792791@cornell.edu> <87k09elrf8.fsf@athena.silentflame.com> <1de33903-4c55-e043-3754-726f7044f2d0@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> 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="2986"; 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 Mon Jun 27 21:19:48 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 1o5uGx-0000WI-Vx for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 Jun 2022 21:19:48 +0200 Original-Received: from localhost ([::1]:42654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5uGw-0007mb-GT for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 Jun 2022 15:19:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5uGE-0007lO-7W for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2022 15:19:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59462) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o5uGD-0003HW-NS for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2022 15:19:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o5uGD-0003rG-I3 for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2022 15:19: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: Mon, 27 Jun 2022 19:19: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.165635749614771 (code B ref 56025); Mon, 27 Jun 2022 19:19:01 +0000 Original-Received: (at 56025) by debbugs.gnu.org; 27 Jun 2022 19:18:16 +0000 Original-Received: from localhost ([127.0.0.1]:53359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5uFT-0003qB-OB for submit@debbugs.gnu.org; Mon, 27 Jun 2022 15:18:16 -0400 Original-Received: from mail-pj1-f45.google.com ([209.85.216.45]:35678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o5uFR-0003px-0D for 56025@debbugs.gnu.org; Mon, 27 Jun 2022 15:18:14 -0400 Original-Received: by mail-pj1-f45.google.com with SMTP id x1-20020a17090abc8100b001ec7f8a51f5so13478946pjr.0 for <56025@debbugs.gnu.org>; Mon, 27 Jun 2022 12:18:12 -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=F13vlW+RHMMcHkIt9cMTCdI3vf39ZzmVzXJeRXT+eYk=; b=cnbJPQR4WZIngf+HGJuhfnzy2ntS3sKIlItSC6Tdqb/vDEX96njeNuM+yO2rhJcRQ9 FyMCq4CBa4AtLGseZfwwCopH4+vqoizQ89SW90/s3M+Klt+WJjX4KEW6XTjUPb3moPwC HXd2u5nzkh9rYMWGUnIoUdDWj46z519YMxHuT+gr243qjxnaKbnW8jae0huAjCrbkKvu z2yaRvOaABXRkNesfRM1mX+/zJhGugxRIO9gdAkqIKv0A+M3UUEXGiAM8PNUNxthoLLb HyL/zv+/hlLo+0KM6Ei4U44P7O+KxB4ArDE+fX2xOlp/irgMO56bTsOI3g250pwVKBs8 3OBA== 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=F13vlW+RHMMcHkIt9cMTCdI3vf39ZzmVzXJeRXT+eYk=; b=5jvuEQH6wKxS96l5scs8wfuvH1D+l5u9W2t8DujyOlmzQeR6hrLL1rkywz3AsqLs8K Lyl3HI3Hx+v8a3MaV+M3zu+OmfAyOuWyyEvIN4iXdiGdQEOGYhSm8P//T2ihAWQGhk5B VIThrF/xd1AS+KK4jx4Ipcji07wufrzRXXq8MakZGcYJnSNwk7Ivn97WK3uZNq4+q89a W2Ar+HyrzJJE4oSPThAe+riA8RSIY0DEjJQ9gFYPSMKLCwNCjZw+zTbW2sh8zCMGpZjk yW6cmX5F2TZqcjopuwshIhpwijj/g6mDhJ9eCdupv3PoguKyLUOrChWZ+H1xLAPHyJ6k Cjhg== X-Gm-Message-State: AJIora/0Sa8AZCoT5PkkmJ3qT5CDruSXz6gcils2plfEZUuC1jcq+6xz r9x2rzg6x8YKZD+r9pIf4bd5Giywup0= X-Google-Smtp-Source: AGRyM1vUPvn/E5puwT+08ossWky7ME7AGcXRGVWce5ifdQazwBW+Yb8uZeAny52hL7gv7gW10lyBRg== X-Received: by 2002:a17:903:2289:b0:16a:7235:afbd with SMTP id b9-20020a170903228900b0016a7235afbdmr16111765plh.120.1656357487030; Mon, 27 Jun 2022 12:18:07 -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 x1-20020a636301000000b004085adf1372sm7480832pgb.77.2022.06.27.12.18.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jun 2022 12:18:06 -0700 (PDT) In-Reply-To: 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:235494 Archived-At: On 6/27/2022 6:25 AM, Ken Brown wrote: > Thanks to all of you for working on this while I was gone. > Unfortunately, the problem is still present on Cygwin.  In my haste to > get away, I neglected to mention that there is apparently a timing issue > in Eshell on Cygwin, so that even three EOFs do not always suffice to > kill the process. > > My test case is to run > >   echo bar | sh -c rev > > in Eshell.  For reasons I don't understand, EOF almost always has to be > sent more than 3 times times before the "sh" process dies.  The maximum > I've observed is 93.  Inserting "(sit-for 0.01)" after each EOF > eliminates the need for extra EOFs; this is why I referred to the > problem as a timing issue. > > I propose the following workaround: > > --- a/lisp/eshell/esh-io.el > +++ b/lisp/eshell/esh-io.el > @@ -284,10 +284,16 @@ eshell-close-target >      ;; end-of-file to the reading process.  However, some platforms >      ;; (e.g. Solaris) actually require sending a *third* EOF.  Since >      ;; sending extra EOFs while the process is running shouldn't break > -    ;; anything, we'll just send the maximum we'd ever need.  See > -    ;; bug#56025 for further details. > -    (let ((i 0)) > -      (while (and (<= (cl-incf i) 3) > +    ;; anything, we'll send up to three on all platforms. > + > +    ;; There's an extra wrinkle on Cygwin where, apparently due to an > +    ;; unknown timing issue, it sometimes takes more than three EOFs > +    ;; to kill the process.  (This only happens in Eshell, not in an > +    ;; ordinary Cygwin shell.)  We work around this problem by sending > +    ;; up to 1000 EOFs on Cygwin.  See bug#56025 for further details. > +    (let ((i 0) > +          (n (if (eq system-type 'cygwin) 1000 3))) > +      (while (and (<= (cl-incf i) n) >                    (eq (process-status target) 'run)) >          (process-send-eof target)))) 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. If there's no other way that we can come up with here, I'd lean towards a defcustom so that users can tweak this if needed.