X-Loop: help-debbugs@HIDDEN Subject: bug#79079: 31.0.50; Piped command output is sometimes lost in Eshell Resent-From: Daniel Mendler <mail@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: jporterbugs@HIDDEN, bug-gnu-emacs@HIDDEN Resent-Date: Wed, 23 Jul 2025 09:57:01 +0000 Resent-Message-ID: <handler.79079.B.175326457314137 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 79079 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 79079 <at> debbugs.gnu.org Cc: Jim Porter <jporterbugs@HIDDEN> X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN X-Debbugs-Original-Xcc: Jim Porter <jporterbugs@HIDDEN> Received: via spool by submit <at> debbugs.gnu.org id=B.175326457314137 (code B ref -1); Wed, 23 Jul 2025 09:57:01 +0000 Received: (at submit) by debbugs.gnu.org; 23 Jul 2025 09:56:13 +0000 Received: from localhost ([127.0.0.1]:48477 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ueWCq-0003fr-Nj for submit <at> debbugs.gnu.org; Wed, 23 Jul 2025 05:56:13 -0400 Received: from lists.gnu.org ([2001:470:142::17]:43644) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1ueWCl-0003f6-99 for submit <at> debbugs.gnu.org; Wed, 23 Jul 2025 05:56:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <mail@HIDDEN>) id 1ueWCf-0001dN-Uj for bug-gnu-emacs@HIDDEN; Wed, 23 Jul 2025 05:56:01 -0400 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1] helo=mail.qxqx.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <mail@HIDDEN>) id 1ueWCb-0003od-IT for bug-gnu-emacs@HIDDEN; Wed, 23 Jul 2025 05:56:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=mA6bB64ytMUQ/WmYpboa6CiGSeTtsenNCWfjZhPLGfg=; b=EGB3ESl1a7dh3swTLqHwNEgon+ 6uur7HNHCVrNqdNntYDG4/Kd0mtuH6pqJGZqqQrgc3C/9kE/2SVvfcXG5p7FWhavWYxWJp/AeTnUD J4ApBC6TQs5+tH9pNvWUK9NzAAbMPtZ4jUVK1+0B+OuOYsPWuh373xFv/bUyZpMT/NdY=; From: Daniel Mendler <mail@HIDDEN> Date: Wed, 23 Jul 2025 11:55:53 +0200 Message-ID: <87pldr5iza.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a01:4f8:c012:9177::1; envelope-from=mail@HIDDEN; helo=mail.qxqx.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.1 (/) Hello, sometimes when executing commands in Eshell with pipes the output seems to get lost, for example: git log | head -n 10 | cat Instead of the expected ten lines of output, there is no output. This problem does not happen always, but from time to time, so maybe there is some timing issue regarding the process handling? In case the issue does not occur immediately one can try this: while true { echo "test"; git log | head -n 1 | cat } For such loops the following error might occur: Creating pipe: Too many open files Cannot redirect stderr: Too many open files, /dev/null I tested this with emacs -Q on Emacs 31 with a relatively recent commit from a few days ago (1e3d76af5a7a16682e71f9df46f6788c0880cccd). Can someone confirm these problems? Thanks! In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.49, cairo version 1.18.4) of 2025-07-15 Windowing system distributor 'The X.Org Foundation', version 11.0.12101016 System Description: Debian GNU/Linux 13 (trixie) Configured using: 'configure --prefix=$HOME/.local/share/emacs --without-compress-install --with-tree-sitter --with-native-compilation --with-dbus --without-selinux --without-threads --disable-gc-mark-trace --without-gsettings --without-gpm --with-cairo --with-cairo-xcb --with-xinput2 --with-x-toolkit=gtk3 --without-toolkit-scroll-bars 'CFLAGS=-O3 -mtune=native -march=native'' Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS HARFBUZZ JPEG LIBOTF LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 TIFF TREE_SITTER WEBP X11 XDBE XIM XINERAMA XINPUT2 XPM XRANDR GTK3 ZLIB
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Daniel Mendler <mail@HIDDEN> Subject: bug#79079: Acknowledgement (31.0.50; Piped command output is sometimes lost in Eshell) Message-ID: <handler.79079.B.175326457314137.ack <at> debbugs.gnu.org> References: <87pldr5iza.fsf@HIDDEN> X-Gnu-PR-Message: ack 79079 X-Gnu-PR-Package: emacs Reply-To: 79079 <at> debbugs.gnu.org Date: Wed, 23 Jul 2025 09:57:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. As you requested using X-Debbugs-CC, your message was also forwarded to Jim Porter <jporterbugs@HIDDEN> (after having been given a bug report number, if it did not have one). Your message has been sent to the package maintainer(s): bug-gnu-emacs@HIDDEN If you wish to submit further information on this problem, please send it to 79079 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 79079: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D79079 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN Subject: bug#79079: 31.0.50; Piped command output is sometimes lost in Eshell Resent-From: Jim Porter <jporterbugs@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 23 Jul 2025 15:53:01 +0000 Resent-Message-ID: <handler.79079.B79079.17532859652615 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 79079 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Daniel Mendler <mail@HIDDEN>, 79079 <at> debbugs.gnu.org Received: via spool by 79079-submit <at> debbugs.gnu.org id=B79079.17532859652615 (code B ref 79079); Wed, 23 Jul 2025 15:53:01 +0000 Received: (at 79079) by debbugs.gnu.org; 23 Jul 2025 15:52:45 +0000 Received: from localhost ([127.0.0.1]:51049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uebls-0000g6-Kv for submit <at> debbugs.gnu.org; Wed, 23 Jul 2025 11:52:45 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:48504) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <jporterbugs@HIDDEN>) id 1ueblp-0000fR-DG for 79079 <at> debbugs.gnu.org; Wed, 23 Jul 2025 11:52:42 -0400 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-3141b84bf65so6400449a91.1 for <79079 <at> debbugs.gnu.org>; Wed, 23 Jul 2025 08:52:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753285955; x=1753890755; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=l+Pp4nDh2+ltybzKKcKjZAL0j2goA4dVOk1Q1pb+fKE=; b=UVoHNsVTpts3AKM6Kd3xlCX17ihL88MZOSMqWtoGwWX15No2SJ+ZD2O9vYPoDHecaW tMK1kmIFmmYPncC1vTKpuijqnvNaXG6D6l2dpjt0qSFXzXg9t3OsaIXjaiTHhz9J91QU kqlitNCWkcf/bya6VYldCbGSVNSlAxRk+Ca+C0TTgMt+3DpD0oRHyL+t+xxUfiGJSm+0 7Kt282mDYrzfNnUE7B5LAH9IN/3XzauX15p3mGAdIZB8TK5/937LZ/GCWrEiMG4/yKI7 yG0Oyv9sMnJ0PRr4vdkcZLx4GgdUkUZ6zVtETJQ2a4QW+ZWcsCAJTXvpD1hiAr0KtvEX /bfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753285955; x=1753890755; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=l+Pp4nDh2+ltybzKKcKjZAL0j2goA4dVOk1Q1pb+fKE=; b=oZR+X5gYXf6LNz0toHobBP8O5x+BX3onttsG4MQGDN2dscYA7FQub5ZhZc4FRy4gMV XpKzNoOdcfWuHyWrd/YEP9oqqLm08rU7TfcRIUc44dm2BLh7/ElmbwpBZdOvd3GFs+5f G7nPqhRUmae9lmpP//3OUQCFR3U4H/XaeimxvDKxgPJFOcG8PM5jcSxBl5E4M/PGkWYB k2G73pKE4s5leuCWYPm+K4K4msnwhtv8wf2fG4+G11aV6md/+oBnxRPn7Z5XOp2SzF3A NgxA4OuvGtEMTpwUXYUnRjTwy3gKF6/2f/YEqxHAHu1ReX9IdxlEO/RzX/SvJB/Kck6k 0u7w== X-Forwarded-Encrypted: i=1; AJvYcCWqKZ7vHdFAWcqHxZ2g+Mqky11M5SUvPsj9c4h1+1P1ahqEjOAFnslXoqsFwk87fHHY/OgxAg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwbefFa4A89xu9GchNgAFcSLZo5164JhcfYstEv+NC5THOlTADV 7hJbHzo+IpUxycSh+bUtQJHrxe7jmW7m6FLGMU15LPMha3ovH+qNz1LsFuyqmg== X-Gm-Gg: ASbGnctrEUbb17lkwlVIQmCCtXtbXTUsQlpNc/swoFBJaTpJCtBpl2Sc9+cpWjeyf9W UsVh/cPiFUjFnU4mndct79n1enUmqGGja/1BewHaCoyfJIjfnjy5pEGJtk024VKr0cZn5QGbrmL Vk3Hz+JZ0STw+AQRdbvaq8jMMkGD3gYn2ocRRKjgtWcHG9BsUQl2+KlWuebKSYHlBfWQmJHy9UK k5V0LkuikHag1EyewresbQqdA0cvewWBCFOjGqi9xdvJLT7Z3xYlIp0xYhcWubZ5A+QSvBnntA/ vgyMA9o1bbHtPiTUX6qJI9HcnP+OuReJxiSSE4ey/guGkM8kvZEJjNGJE0Zkb2tbQ/lc9i+n2tP /haR9LEA78iOP7eLYdHP+Kh+lcnFzwofkNmKUc0bXdPQq8u4N93W3qvFxMMrR5c/DgiYMpVd2Tl NKng== X-Google-Smtp-Source: AGHT+IExnna1CVcZ8i40b6dgB0Cp1kTZEiMOvhEktXYsOFgeIMlQS8/MLfCOSynECj5TI4mq0trm5A== X-Received: by 2002:a17:90b:1f81:b0:31c:ad57:b97a with SMTP id 98e67ed59e1d1-31e507ab2admr5145795a91.13.1753285955141; Wed, 23 Jul 2025 08:52:35 -0700 (PDT) Received: from [192.168.1.2] (syn-076-168-144-128.res.spectrum.com. [76.168.144.128]) by smtp.googlemail.com with ESMTPSA id 98e67ed59e1d1-31e519f4f0fsm1950053a91.10.2025.07.23.08.52.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Jul 2025 08:52:34 -0700 (PDT) Message-ID: <26784dc3-a846-b880-a023-c3e7d8da3399@HIDDEN> Date: Wed, 23 Jul 2025 08:52:36 -0700 MIME-Version: 1.0 Content-Language: en-US References: <87pldr5iza.fsf@HIDDEN> From: Jim Porter <jporterbugs@HIDDEN> In-Reply-To: <87pldr5iza.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 7/23/2025 2:55 AM, Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > sometimes when executing commands in Eshell with pipes the output seems > to get lost, for example: [snip] > Can someone confirm these problems? Thanks! I'm not able to reproduce this locally, but if you first run "eshell-debug process", that will log a bunch of process-related information to the buffer "*eshell last cmd*". That would probably have some details that at least show where the I/O went missing.
X-Loop: help-debbugs@HIDDEN Subject: bug#79079: 31.0.50; Piped command output is sometimes lost in Eshell Resent-From: Daniel Mendler <mail@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 23 Jul 2025 16:38:02 +0000 Resent-Message-ID: <handler.79079.B79079.175328863714529 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 79079 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jim Porter <jporterbugs@HIDDEN> Cc: 79079 <at> debbugs.gnu.org Received: via spool by 79079-submit <at> debbugs.gnu.org id=B79079.175328863714529 (code B ref 79079); Wed, 23 Jul 2025 16:38:02 +0000 Received: (at 79079) by debbugs.gnu.org; 23 Jul 2025 16:37:17 +0000 Received: from localhost ([127.0.0.1]:51257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uecSy-0003mC-6A for submit <at> debbugs.gnu.org; Wed, 23 Jul 2025 12:37:16 -0400 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:55549 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1uecSn-0003lH-9T for 79079 <at> debbugs.gnu.org; Wed, 23 Jul 2025 12:37:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=FMVPeLZb2hrAhdW9liaGUtLEOrhR6BS1ungrVwmrbgI=; b=qThM1vsS0wDhgE5Qi9HGAS/DqA 5WpNf/uZBlJFx26/kCn1BvZvhvbppgWOJTM/P2V2yrdBiGY6XZp7gNtpNC63IeIIJU0M5KWt7mcH7 We7mJRnuPIFJ7YuQjPp2lDZ+W6jzsuO4hRQh4A+hzbEKYtQaWoVlSr3PfIy+Go+/fmaw=; From: Daniel Mendler <mail@HIDDEN> In-Reply-To: <26784dc3-a846-b880-a023-c3e7d8da3399@HIDDEN> References: <87pldr5iza.fsf@HIDDEN> <26784dc3-a846-b880-a023-c3e7d8da3399@HIDDEN> Date: Wed, 23 Jul 2025 18:36:56 +0200 Message-ID: <87ikji6ezb.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) Jim Porter <jporterbugs@HIDDEN> writes: > On 7/23/2025 2:55 AM, Daniel Mendler via Bug reports for GNU Emacs, the S= wiss > army knife of text editors wrote: >> sometimes when executing commands in Eshell with pipes the output seems >> to get lost, for example: > [snip] >> Can someone confirm these problems? Thanks! > > I'm not able to reproduce this locally, but if you first run "eshell-debug > process", that will log a bunch of process-related information to the buf= fer > "*eshell last cmd*". That would probably have some details that at least = show > where the I/O went missing. Thanks. I tried your suggestion. What stood out is that in the failed runs, the output from the git process is received, and passed on to the head process, but no output is received from head. It seems that the head filter function is never called? This would hint at a lower-level problem. See the logs of the runs below. The problem occurs in particular for this command: git log --color=3Dalways --decorate=3Dyes | head -n 1 While it does not happen (or not so often) for this: git log --color=3Dalways --decorate=3Dyes | cat | head -n 1 Did you try the loop with the echo and the command? Do you have any further suggestions on how to debug this? Maybe it has something to do with my specific build. Daniel ### Good run [process] started external process =E2=80=98head=E2=80=99 [process] started external process =E2=80=98git=E2=80=99 [process] received output from process =E2=80=98git=E2=80=99 [process] forwarding output from process =E2=80=98git=E2=80=99 [process] received output from process =E2=80=98head=E2=80=99 <=3D=3D=3D=3D= =3D received output [process] received output from process =E2=80=98git=E2=80=99 [process] forwarding output from process =E2=80=98git=E2=80=99 [process] received output from process =E2=80=98git=E2=80=99 [process] forwarding output from process =E2=80=98git=E2=80=99 [process] sentinel for external process =E2=80=98git=E2=80=99: "broken pipe [process] i/o busy for process =E2=80=98git=E2=80=99 [process] sentinel for external process =E2=80=98git-stderr=E2=80=99: "fini= shed [process] finished external process =E2=80=98git-stderr=E2=80=99 [process] sentinel for external process =E2=80=98head=E2=80=99: "finished <= =3D=3D=3D=3D=3D finished [process] finished external process =E2=80=98head=E2=80=99 [process] finished external process =E2=80=98git=E2=80=99 ### Bad run [process] started external process =E2=80=98head=E2=80=99 [process] started external process =E2=80=98git=E2=80=99 [process] received output from process =E2=80=98git=E2=80=99 [process] forwarding output from process =E2=80=98git=E2=80=99 [process] received output from process =E2=80=98git=E2=80=99 [process] forwarding output from process =E2=80=98git=E2=80=99 [process] received output from process =E2=80=98git=E2=80=99 [process] forwarding output from process =E2=80=98git=E2=80=99 [process] sentinel for external process =E2=80=98head=E2=80=99: "finished [process] finished external process =E2=80=98head=E2=80=99 <=3D=3D=3D=3D=3D= finished without output [process] sentinel for external process =E2=80=98git=E2=80=99: "broken pipe [process] i/o busy for process =E2=80=98git=E2=80=99 [process] sentinel for external process =E2=80=98git-stderr=E2=80=99: "fini= shed [process] finished external process =E2=80=98git-stderr=E2=80=99 [process] finished external process =E2=80=98git=E2=80=99
X-Loop: help-debbugs@HIDDEN Subject: bug#79079: 31.0.50; Piped command output is sometimes lost in Eshell Resent-From: Jim Porter <jporterbugs@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 23 Jul 2025 18:07:02 +0000 Resent-Message-ID: <handler.79079.B79079.175329399216282 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 79079 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Daniel Mendler <mail@HIDDEN>, 79079 <at> debbugs.gnu.org, eliz@HIDDEN Received: via spool by 79079-submit <at> debbugs.gnu.org id=B79079.175329399216282 (code B ref 79079); Wed, 23 Jul 2025 18:07:02 +0000 Received: (at 79079) by debbugs.gnu.org; 23 Jul 2025 18:06:32 +0000 Received: from localhost ([127.0.0.1]:51752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uedrM-0004EX-4X for submit <at> debbugs.gnu.org; Wed, 23 Jul 2025 14:06:32 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:42360) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <jporterbugs@HIDDEN>) id 1uedrJ-0004Ds-Tc for 79079 <at> debbugs.gnu.org; Wed, 23 Jul 2025 14:06:30 -0400 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-2350fc2591dso2492025ad.1 for <79079 <at> debbugs.gnu.org>; Wed, 23 Jul 2025 11:06:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753293984; x=1753898784; darn=debbugs.gnu.org; h=in-reply-to:references:to:from:content-language:subject :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=iirs8EQ41rW4tyh/S1Wuq+3up8gtkefEdyqmNgAeNUA=; b=Ksc9d+S8Zlz6NdE2zLZZ7PjkfQZoXXnGfP9oInHjpVMIeJie58JqyG9ie2sL1yo3Gi Yyza1Cl7y6p/dEKzar5F+kmwDGgqyecg5ZQfArStb2+u2L6aoNWUBulot2KwPwzQo0p2 daNhvGm5r6vYVwMCnEVq04vKC6jSTOHB3NeicjE8UmuCPm+qBlcsNOWVTt4iRutmXj8T GU5+7lhSRhnCD6NNGRrmZ9CHh9rwpwBYqiou5KG9FasKDAlfwuiKyfTWyViw2j0IEv5o Wog9+SzgSsepd7kgcpLUnw05bq0zzMjon9iYhg4d6Siytn/49/b5/OD5rPJ9ge/RAFnt mmGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753293984; x=1753898784; h=in-reply-to:references:to:from:content-language:subject :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=iirs8EQ41rW4tyh/S1Wuq+3up8gtkefEdyqmNgAeNUA=; b=g+6wGpryMJlZJWSO5FlT8/9/7+ja0A6HSz8A8U18cQjC7eXBiYxMLZt3RiL8WifYW8 1u0Llj53DDEVXFlVdg0LDjXiDPDa8K3ORUEErdlroiFdeUKE5OpXuuPYxdjGcnNyznsF PjIrYU5wPyw5MFE8MpFrphi0mGBzVHjWnH2DyIwu/OEGTNBDccO/1C/CuzSnSYOP7lPp rpSJD2O6FM6PK60xxCO9kQkhE8LfSj4Albzx0OAgHJmAUOtE/EWfpo8INwfRFVF1w7by /mspNmxFg8ZFSU7rEBprAzVQL+SwjJaQhrFPID3zrEbrYPaN/9+p4AxDkbplnWotrHro hAAw== X-Forwarded-Encrypted: i=1; AJvYcCVZYzAZLKmAdkGR0375JarK6+7vxNxBXt8bgoslrNeHHTuS0Jm1Lei0oK0muYs8fRSJqjL6gw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxMN95J39liCKEYSWyysCtg1hO8QBrUD4rgY0pIwoobd6Nsmk1W tSWP1UQ8NIE/kzetkgrCEE9B06N5LlZrK20t5Rqy5LXL6L9peJN6wAKM X-Gm-Gg: ASbGncttakOq2NGMeh2npXmpIkZNlAbeStqozlv2Z4oolElrx4mdQ0wD5Ef4Hh36/Tb t8MR93l2ut0bUVomNY5pYyDLiRb5zU62YiwAWog+/aWlUqNXDV8dB6uSt4dPoJpWoNM0XCQLocU gRgQMXWWzj7NxBBd6h8Gjp7rBXYlCo+EhevEmzWYgN3UTVvUjT8N9UW2/hk0NVd2nv3jbrlKYBr OY0X63ACYarfzGBw7NHY/CB32cy6YC+YnBNtO5oLT/pwC0BiqbbGZeBuYsZL65HRDZOBz04r6kR xwPb+fthLS7NfVAS39DB8Zp/Z4NAbR5xgHdIB7iElnadN3IpyQg0qMnS/xVG8703te2AWFMXqVV 5FYR3b1/jIrOA8nObu1C6cvvTS9WbIdkTQrrIMY4SPauog0rrQVfFIcEGafKptIYBvWlnX7Kg/8 VyiA== X-Google-Smtp-Source: AGHT+IGx+RR/9JuXFN7xmGjbqps4g081jVw2IX4YBkSWvYpDdYbfC/jACYoeESwvzWO5g4R9MW8/5w== X-Received: by 2002:a17:903:8cc:b0:235:278c:7d06 with SMTP id d9443c01a7336-23f98293fbdmr61826995ad.8.1753293983582; Wed, 23 Jul 2025 11:06:23 -0700 (PDT) Received: from [192.168.1.2] (syn-076-168-144-128.res.spectrum.com. [76.168.144.128]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-23e3bdfe68csm100271005ad.183.2025.07.23.11.06.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Jul 2025 11:06:22 -0700 (PDT) Content-Type: multipart/mixed; boundary="------------3BvCia0jq3tE7vWYEGLLS1x1" Message-ID: <f48fb759-2a23-19be-5a76-6d2f32f35478@HIDDEN> Date: Wed, 23 Jul 2025 11:06:24 -0700 MIME-Version: 1.0 Content-Language: en-US From: Jim Porter <jporterbugs@HIDDEN> References: <87pldr5iza.fsf@HIDDEN> <26784dc3-a846-b880-a023-c3e7d8da3399@HIDDEN> In-Reply-To: <26784dc3-a846-b880-a023-c3e7d8da3399@HIDDEN> X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------3BvCia0jq3tE7vWYEGLLS1x1 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/23/2025 8:52 AM, Jim Porter wrote: > I'm not able to reproduce this locally, but if you first run > "eshell-debug process", that will log a bunch of process-related > information to the buffer "*eshell last cmd*". That would probably have > some details that at least show where the I/O went missing. After a few more tries, I was able to reproduce this very rarely. Does the following patch help? Eli: maybe you can help with some of the details here. In process.c, when we write to a process, we handle EPIPE errors by calling 'deactivate_process'. However, that can lead to us dropping any data written *by* that process, since we don't call the process's filter function for any remaining output still in our internal buffer. I think in this case, we'd just want to let the rest of our code handle deactivating the process in the usual way. That helps fix this bug, plus I think it makes sense in general. If a process closes stdin, I believe we'd get the EPIPE error, but that process might want to continue working (though it does mean that you could only interact with that process via signaling it). Does that make sense? --------------3BvCia0jq3tE7vWYEGLLS1x1 Content-Type: text/plain; charset=UTF-8; name="epipe.diff" Content-Disposition: attachment; filename="epipe.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9wcm9jZXNzLmMgYi9zcmMvcHJvY2Vzcy5jCmluZGV4IGU2MWVj NDI1ZjdlLi4yNThiZWUyMWI1ZSAxMDA2NDQKLS0tIGEvc3JjL3Byb2Nlc3MuYworKysgYi9z cmMvcHJvY2Vzcy5jCkBAIC02ODc2LDcgKzY4NzYsNiBAQCBzZW5kX3Byb2Nlc3MgKExpc3Bf T2JqZWN0IHByb2MsIGNvbnN0IGNoYXIgKmJ1ZiwgcHRyZGlmZl90IGxlbiwKICAgICAgICAg ICAgICAgICAgcC0+cmF3X3N0YXR1c19uZXcgPSAwOwogICAgICAgICAgICAgICAgICBwc2V0 X3N0YXR1cyAocCwgbGlzdDIgKFFleGl0LCBtYWtlX2ZpeG51bSAoMjU2KSkpOwogICAgICAg ICAgICAgICAgICBwLT50aWNrID0gKytwcm9jZXNzX3RpY2s7Ci0gICAgICAgICAgICAgICAg IGRlYWN0aXZhdGVfcHJvY2VzcyAocHJvYyk7CiAgICAgICAgICAgICAgICAgIGVycm9yICgi UHJvY2VzcyAlcyBubyBsb25nZXIgY29ubmVjdGVkIHRvIHBpcGU7IGNsb3NlZCBpdCIsCiAg ICAgICAgICAgICAgICAgICAgICAgICBTREFUQSAocC0+bmFtZSkpOwogICAgICAgICAgICAg ICAgfQ== --------------3BvCia0jq3tE7vWYEGLLS1x1--
X-Loop: help-debbugs@HIDDEN Subject: bug#79079: 31.0.50; Piped command output is sometimes lost in Eshell Resent-From: Daniel Mendler <mail@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 23 Jul 2025 18:18:01 +0000 Resent-Message-ID: <handler.79079.B79079.175329467919046 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 79079 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jim Porter <jporterbugs@HIDDEN> Cc: eliz@HIDDEN, 79079 <at> debbugs.gnu.org Received: via spool by 79079-submit <at> debbugs.gnu.org id=B79079.175329467919046 (code B ref 79079); Wed, 23 Jul 2025 18:18:01 +0000 Received: (at 79079) by debbugs.gnu.org; 23 Jul 2025 18:17:59 +0000 Received: from localhost ([127.0.0.1]:51778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uee2Q-0004x8-Kd for submit <at> debbugs.gnu.org; Wed, 23 Jul 2025 14:17:58 -0400 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:33517 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1uee2O-0004we-3x for 79079 <at> debbugs.gnu.org; Wed, 23 Jul 2025 14:17:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=UPFmLFIAUKmkG8DOjrpDizJcw/qswhPMmH9RQAgFLBk=; b=UpaCgETmFx+JFJ+5vnL2uFsqTA aGtRoOvEczRpd0HuQoF7amybw+/hLnC0afbwjQTdxujQEYBM7685QxPwq40Y+V7JIoLr2l8rnc3Ks cZJhXxCJgxgfPWPG0OEmZ8qXV+woABhPBasBLGDVmxF4BlKI3oQVOmsvlPtBlqtcwTjI=; From: Daniel Mendler <mail@HIDDEN> In-Reply-To: <f48fb759-2a23-19be-5a76-6d2f32f35478@HIDDEN> References: <87pldr5iza.fsf@HIDDEN> <26784dc3-a846-b880-a023-c3e7d8da3399@HIDDEN> <f48fb759-2a23-19be-5a76-6d2f32f35478@HIDDEN> Date: Wed, 23 Jul 2025 20:17:47 +0200 Message-ID: <87cy9q6ab8.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) Jim Porter <jporterbugs@HIDDEN> writes: > On 7/23/2025 8:52 AM, Jim Porter wrote: >> I'm not able to reproduce this locally, but if you first run "eshell-debug >> process", that will log a bunch of process-related information to the buffer >> "*eshell last cmd*". That would probably have some details that at least show >> where the I/O went missing. > > After a few more tries, I was able to reproduce this very rarely. Does the > following patch help? Thanks for looking into this so quickly and coming up with a patch! I can check this earliest end of next week. Recompiling Emacs always takes me a little bit longer than simply evaluating some Elisp. > Eli: maybe you can help with some of the details here. In process.c, when we > write to a process, we handle EPIPE errors by calling 'deactivate_process'. > However, that can lead to us dropping any data written *by* that process, since > we don't call the process's filter function for any remaining output still in > our internal buffer. > > I think in this case, we'd just want to let the rest of our code handle > deactivating the process in the usual way. That helps fix this bug, plus I think > it makes sense in general. If a process closes stdin, I believe we'd get the > EPIPE error, but that process might want to continue working (though it does > mean that you could only interact with that process via signaling it). Maybe this also needs some test to avoid regressions? Did you find a way to reliably reproduce the problem? > Does that make sense? > > diff --git a/src/process.c b/src/process.c > index e61ec425f7e..258bee21b5e 100644 > --- a/src/process.c > +++ b/src/process.c > @@ -6876,7 +6876,6 @@ send_process (Lisp_Object proc, const char *buf, ptrdiff_t len, > p->raw_status_new = 0; > pset_status (p, list2 (Qexit, make_fixnum (256))); > p->tick = ++process_tick; > - deactivate_process (proc); > error ("Process %s no longer connected to pipe; closed it", > SDATA (p->name)); > }
X-Loop: help-debbugs@HIDDEN Subject: bug#79079: 31.0.50; Piped command output is sometimes lost in Eshell Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 24 Jul 2025 05:35:02 +0000 Resent-Message-ID: <handler.79079.B79079.175333525531938 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 79079 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jim Porter <jporterbugs@HIDDEN>, Paul Eggert <eggert@HIDDEN> Cc: mail@HIDDEN, 79079 <at> debbugs.gnu.org Received: via spool by 79079-submit <at> debbugs.gnu.org id=B79079.175333525531938 (code B ref 79079); Thu, 24 Jul 2025 05:35:02 +0000 Received: (at 79079) by debbugs.gnu.org; 24 Jul 2025 05:34:15 +0000 Received: from localhost ([127.0.0.1]:54015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ueoat-0008J2-4c for submit <at> debbugs.gnu.org; Thu, 24 Jul 2025 01:34:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40616) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1ueoar-0008IZ-98 for 79079 <at> debbugs.gnu.org; Thu, 24 Jul 2025 01:34:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1ueoak-00049o-6r; Thu, 24 Jul 2025 01:34:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=b/iqVqCuTmeMDiOy7zlurQWb1vwTxWkdnDH1BHYXTwc=; b=UlPHWMsd6IhM S9c80USA5Ea9sGQ+Jm4GE0dWeKGgHRcYqV8nDo6TrsHYVxwcwK5wSHvdLfjAPqbRET+uxcrlRh3uL 8jKazHchZzhwFDMqtBNbu4RUwPGRS0gBFJSNRAAUqNpvGMHxbyvaP9jwmpZbf++FtoQSZ7NXup0eG RZMreYc9+i3ImRFK9CjEyQhjgbivGExjnufpVq6IL7dlnFGQXdCcNO8DDepzFo7/KLmhzZu7EV3Ej UU/Cs5VvY9WbNCHRStZsYlM35u+pVk1Hm6jHCYnpfmO/Jc0D+PNsg6nvrQEDd/6jK4TIBExwePcpa MRTwDzfdzP05KsIqGEX6Sw==; Date: Thu, 24 Jul 2025 08:34:03 +0300 Message-Id: <864iv26tkk.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <f48fb759-2a23-19be-5a76-6d2f32f35478@HIDDEN> (message from Jim Porter on Wed, 23 Jul 2025 11:06:24 -0700) References: <87pldr5iza.fsf@HIDDEN> <26784dc3-a846-b880-a023-c3e7d8da3399@HIDDEN> <f48fb759-2a23-19be-5a76-6d2f32f35478@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Date: Wed, 23 Jul 2025 11:06:24 -0700 > From: Jim Porter <jporterbugs@HIDDEN> > > On 7/23/2025 8:52 AM, Jim Porter wrote: > > I'm not able to reproduce this locally, but if you first run > > "eshell-debug process", that will log a bunch of process-related > > information to the buffer "*eshell last cmd*". That would probably have > > some details that at least show where the I/O went missing. > > After a few more tries, I was able to reproduce this very rarely. Does > the following patch help? > > Eli: maybe you can help with some of the details here. In process.c, > when we write to a process, we handle EPIPE errors by calling > 'deactivate_process'. However, that can lead to us dropping any data > written *by* that process, since we don't call the process's filter > function for any remaining output still in our internal buffer. > > I think in this case, we'd just want to let the rest of our code handle > deactivating the process in the usual way. That helps fix this bug, plus > I think it makes sense in general. If a process closes stdin, I believe > we'd get the EPIPE error, but that process might want to continue > working (though it does mean that you could only interact with that > process via signaling it). > > Does that make sense? Sounds a somewhat scary change, since this code was last touched 13 years ago. Paul, WDYT? What about calling the filter with the data we still have? Isn't that what a Posix shell would do -- flush any buffers? And why do we get EPIPE in the recipe in this bug, anyway? I'd like to understand better at least one situation where we get EPIPE while the data received before that still matters.
X-Loop: help-debbugs@HIDDEN Subject: bug#79079: 31.0.50; Piped command output is sometimes lost in Eshell Resent-From: Paul Eggert <eggert@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 24 Jul 2025 13:53:02 +0000 Resent-Message-ID: <handler.79079.B79079.175336516912528 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 79079 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: Jim Porter <jporterbugs@HIDDEN>, mail@HIDDEN, 79079 <at> debbugs.gnu.org Received: via spool by 79079-submit <at> debbugs.gnu.org id=B79079.175336516912528 (code B ref 79079); Thu, 24 Jul 2025 13:53:02 +0000 Received: (at 79079) by debbugs.gnu.org; 24 Jul 2025 13:52:49 +0000 Received: from localhost ([127.0.0.1]:55777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uewNN-0003G0-5N for submit <at> debbugs.gnu.org; Thu, 24 Jul 2025 09:52:49 -0400 Received: from mail.cs.ucla.edu ([131.179.128.66]:46008) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eggert@HIDDEN>) id 1uewNJ-0003FZ-UB for 79079 <at> debbugs.gnu.org; Thu, 24 Jul 2025 09:52:47 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 45CD93C01084A; Thu, 24 Jul 2025 06:52:40 -0700 (PDT) Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP id nP6OunJTDlfU; Thu, 24 Jul 2025 06:52:40 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 19FEF3C010841; Thu, 24 Jul 2025 06:52:40 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 19FEF3C010841 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1753365160; bh=BqGXE9X9HvCb167X23q9wBgiciAa14REhEt9S/BWREo=; h=Message-ID:Date:MIME-Version:To:From; b=qz+ykQMPKwGROaqLO9FhjLLcJHOXp9JnSh7tkYr/U6nyThb04L49lcdqvRZjDt8Cu 8sEK21b5/iQzO3wEbKzdFydfStXza8MWbPeSO/mrGYcPajL9CzHWUVmBsL9WZDFv40 FwsPRgvIr6szuPUDKzIIJRoEdeK88R6EBWlLSfQAwYXpBDMmMiI6Nrc9/giIAbcpL7 WdHtUJG4RRWSbHxe9AKj4bUqJ6edwTNMtSDE0ptcB2u2DMw1yhOpgK/SG/qbDN6EtE sL5icG1RQBMwKgZi7NHoiLCQ4O1ggcBqn4Bc4+1nXUoxLUi5ZLvqVVyqRloy8yBvNm zeH/Z3rsm592A== X-Virus-Scanned: amavis at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id ZCWPRofmc9Ot; Thu, 24 Jul 2025 06:52:40 -0700 (PDT) Received: from penguin.cs.ucla.edu (unknown [47.154.30.222]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id E31873C01084A; Thu, 24 Jul 2025 06:52:39 -0700 (PDT) Message-ID: <fa47910e-efad-4b4d-b56c-f0f47d6085b8@HIDDEN> Date: Thu, 24 Jul 2025 06:52:39 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird References: <87pldr5iza.fsf@HIDDEN> <26784dc3-a846-b880-a023-c3e7d8da3399@HIDDEN> <f48fb759-2a23-19be-5a76-6d2f32f35478@HIDDEN> <864iv26tkk.fsf@HIDDEN> Content-Language: en-US From: Paul Eggert <eggert@HIDDEN> Organization: UCLA Computer Science Department In-Reply-To: <864iv26tkk.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 2025-07-23 22:34, Eli Zaretskii wrote: >> Date: Wed, 23 Jul 2025 11:06:24 -0700 >> From: Jim Porter<jporterbugs@HIDDEN> >> In process.c, >> when we write to a process, we handle EPIPE errors by calling >> 'deactivate_process'. However, that can lead to us dropping any data >> written*by* that process, since we don't call the process's filter >> function for any remaining output still in our internal buffer. >> >> I think in this case, we'd just want to let the rest of our code handle >> deactivating the process in the usual way. That helps fix this bug, plus >> I think it makes sense in general. If a process closes stdin, I believe >> we'd get the EPIPE error, but that process might want to continue >> working (though it does mean that you could only interact with that >> process via signaling it). Yes, that makes sense. > What about calling the filter with the data we still have? Isn't that > what a Posix shell would do -- flush any buffers? Not sure what you man by that, but I suspect it wouldn't handle the scenario Jim describes, where the other process closes its end of the pipe but keeps running. Emacs shouldn't assume that EPIPE means the other process has died or has closed any pipes other than the one Emacs got EPIPE on.
X-Loop: help-debbugs@HIDDEN Subject: bug#79079: 31.0.50; Piped command output is sometimes lost in Eshell Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 24 Jul 2025 14:57:01 +0000 Resent-Message-ID: <handler.79079.B79079.175336900831732 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 79079 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Paul Eggert <eggert@HIDDEN> Cc: jporterbugs@HIDDEN, mail@HIDDEN, 79079 <at> debbugs.gnu.org Received: via spool by 79079-submit <at> debbugs.gnu.org id=B79079.175336900831732 (code B ref 79079); Thu, 24 Jul 2025 14:57:01 +0000 Received: (at 79079) by debbugs.gnu.org; 24 Jul 2025 14:56:48 +0000 Received: from localhost ([127.0.0.1]:57465 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uexNH-0008Fi-IQ for submit <at> debbugs.gnu.org; Thu, 24 Jul 2025 10:56:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34136) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uexNE-0008FB-TN for 79079 <at> debbugs.gnu.org; Thu, 24 Jul 2025 10:56:45 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1uexN8-0005NN-0b; Thu, 24 Jul 2025 10:56:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=aWkv5GJTVUZ07qrcouJ4ZKUw64OYSiaZ5NrvtQKqh3k=; b=Ow7PDF8iRsrT UQ1VJo/WkHS3ibCw2Gq3WP379n/ux9HWCyhNYGY1ZRWgxVdzoKv5S4Jzfv5CMax8FstGdJGs3i+bZ nB1/fV1O90OweAkjdlcFMImp58+dJBQMO4ILIMAqrEBDIvrVgI8oJrI+ebq7/8aj67cbQd4R2B8mI XZVbdlOlezOzmJ+skUQvGb5r9uynm4BHDRi9MHguB7Z9/XHR9JP5R/G1DCd/1LTj65LvZVZWcKMmc VTW5AIYPoHfDrD7jNNn96QHDy4bGTHQfDxul6AiliynWn3ovIE6vlDPxzm2/H03XanLZDO9sOb0pD g9spxgWQvKJ9BokB0o7izA==; Date: Thu, 24 Jul 2025 17:56:35 +0300 Message-Id: <86cy9p63j0.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <fa47910e-efad-4b4d-b56c-f0f47d6085b8@HIDDEN> (message from Paul Eggert on Thu, 24 Jul 2025 06:52:39 -0700) References: <87pldr5iza.fsf@HIDDEN> <26784dc3-a846-b880-a023-c3e7d8da3399@HIDDEN> <f48fb759-2a23-19be-5a76-6d2f32f35478@HIDDEN> <864iv26tkk.fsf@HIDDEN> <fa47910e-efad-4b4d-b56c-f0f47d6085b8@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Date: Thu, 24 Jul 2025 06:52:39 -0700 > Cc: mail@HIDDEN, 79079 <at> debbugs.gnu.org, > Jim Porter <jporterbugs@HIDDEN> > From: Paul Eggert <eggert@HIDDEN> > > >> I think in this case, we'd just want to let the rest of our code handle > >> deactivating the process in the usual way. That helps fix this bug, plus > >> I think it makes sense in general. If a process closes stdin, I believe > >> we'd get the EPIPE error, but that process might want to continue > >> working (though it does mean that you could only interact with that > >> process via signaling it). > > Yes, that makes sense. > > > > What about calling the filter with the data we still have? Isn't that > > what a Posix shell would do -- flush any buffers? > > Not sure what you man by that, but I suspect it wouldn't handle the > scenario Jim describes, where the other process closes its end of the > pipe but keeps running. Emacs shouldn't assume that EPIPE means the > other process has died or has closed any pipes other than the one Emacs > got EPIPE on. I guess I'm confused: if the other process closed its end of the pipe, why do we care about the stuff we have in our buffers that wasn't yet piped to that other process?
X-Loop: help-debbugs@HIDDEN Subject: bug#79079: 31.0.50; Piped command output is sometimes lost in Eshell Resent-From: Jim Porter <jporterbugs@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 24 Jul 2025 15:53:02 +0000 Resent-Message-ID: <handler.79079.B79079.175337235026623 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 79079 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN>, Paul Eggert <eggert@HIDDEN> Cc: mail@HIDDEN, 79079 <at> debbugs.gnu.org Received: via spool by 79079-submit <at> debbugs.gnu.org id=B79079.175337235026623 (code B ref 79079); Thu, 24 Jul 2025 15:53:02 +0000 Received: (at 79079) by debbugs.gnu.org; 24 Jul 2025 15:52:30 +0000 Received: from localhost ([127.0.0.1]:57767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ueyFC-0006vJ-8j for submit <at> debbugs.gnu.org; Thu, 24 Jul 2025 11:52:30 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:51413) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <jporterbugs@HIDDEN>) id 1ueyF4-0006ua-9p for 79079 <at> debbugs.gnu.org; Thu, 24 Jul 2025 11:52:27 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-747c2cc3419so1025908b3a.2 for <79079 <at> debbugs.gnu.org>; Thu, 24 Jul 2025 08:52:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753372336; x=1753977136; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=7xRzVIbkzIqRsrtf7WSGo33Va/tz15BgeppEKMe7EdE=; b=fAmR7N//ZNBTudzZ/L5hcuxOccbyF9arpPTX23z45tHYH2koTWDUzrpwk8TSZXIxEq VpmA5lbPqIBn88Jz0UZI3AO1ZlXmJ7gxTEYe5m8P7+oxiLrRW7fBh2YQZTIJYsunL+dY 3ZgYxsUxyJDbysAoLzsMk8H2oOe15r9cvPy4wyWOkvs0uflMqlqkpkSTgxdWClhOIR5D 35Eo+d/cHtf5lhAUVN3fF8J+BtTav/PLJa77CLuWG/LaZVQQnwxesbTBGEr9VRvzGJ/3 DWxXjlshVmkY5vwzOs5sY07/wMukzyQUq32JZV/1bbDtSIsfxh2+PG4WDGanUmp/4knF zhKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753372336; x=1753977136; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7xRzVIbkzIqRsrtf7WSGo33Va/tz15BgeppEKMe7EdE=; b=lKmXL0vkk3BdKCnpyoqxinK+OVmj/Rep7HF6Bi1x+RXYm/XXORwrObB1eIXruGBK3S IohcC8LuOi/WUDjAWgz5PpskvARFk8yz/D/qTM69rIzBEPex/8xD09RA5KDlIzVjPiX9 mFD0somP35LWVyPX4P3QAsVtVzKYYrt4TgRd6qXMYfd7raBhykgV3nt9GhSTsI9x/Sod m6BgXdimDSPQp8FKnJG9MmMZszrYbBCqnW/4DT2q4aa9hPz94uxxFUhiV6zlncvMC+lr gMGYF4PJCg12TH0Fm1tiRliUsnUz08J3prBHP5C5vBWb+ZZrKeULf6agMQyP6Gstzq6j SPzw== X-Forwarded-Encrypted: i=1; AJvYcCVRvu7clrpVxDdvH22+V/SH8uzhwJS6LF8S31E0wgLWS1h2dmHcTTelmukez1irfKLlYoh+Aw==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yy+PuH5MuCzBqzrv7fbHH+n4ef8ooGlrOK+ZRy7WFk/0B0QfeqE Gq864qruiluwG7HQ70dkvpJtllGWixXw9DDOrryxPObkwpoP4eXo3xHWtZk7fQ== X-Gm-Gg: ASbGnctVcTKy0OVQnfEGNHDjlQQTIA/lJ5nPXiI1/cxqqvbBxa/+8G6pkCxufMRD8ZT GVKFxZY4t8G7lpifC7jYnW1ZlHCJQatU8HJ4X1v2og7gYEh8NOeT2FlknNHT3TfxR8ZfENBWtOk tH9nS6LPpk5B3IFSfFC2vPAbAPwY5VRIugwLil7CBQra4jNpurBvVEDFUXn/DUMf1XJ0ps+q5GH GdUjW0vBsl2TSmMer6Yis62BLMI3+ed9bpI6UXMagHEEVBMdWp943qY/hDigEIxEAjicOHWjFGx DYxQS5r7/ssNXb//gkAeY3Wi/ZjxqL2kXkIuln2QT4WJz4elSR2Yp2btrntYvmPpwPtRAq41SRY LkjwwD5vPCUp4cLZCMuzlxbjRmkF5wGitAjVLwlTksSE9rqEWfUTfg51492gc+sc0ER8lsGfzsC ezPXlT7skl6y7s X-Google-Smtp-Source: AGHT+IGBx0EmlKYuXvSFxA28Y/hXxyEMJrK5AetggZk1+ZnWAMon+edLshn+8CjwTzf0M5FKVnfsfQ== X-Received: by 2002:a05:6a00:228a:b0:748:323f:ba21 with SMTP id d2e1a72fcca58-76034c00474mr10156796b3a.1.1753372335677; Thu, 24 Jul 2025 08:52:15 -0700 (PDT) Received: from [192.168.1.2] (syn-076-168-144-128.res.spectrum.com. [76.168.144.128]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-761b05ec57esm1955043b3a.100.2025.07.24.08.52.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Jul 2025 08:52:15 -0700 (PDT) Message-ID: <79cd6ad9-f939-6b8a-ebe0-83b0b0475b62@HIDDEN> Date: Thu, 24 Jul 2025 08:52:16 -0700 MIME-Version: 1.0 Content-Language: en-US References: <87pldr5iza.fsf@HIDDEN> <26784dc3-a846-b880-a023-c3e7d8da3399@HIDDEN> <f48fb759-2a23-19be-5a76-6d2f32f35478@HIDDEN> <864iv26tkk.fsf@HIDDEN> From: Jim Porter <jporterbugs@HIDDEN> In-Reply-To: <864iv26tkk.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 7/23/2025 10:34 PM, Eli Zaretskii wrote: > What about calling the filter with the data we still have? Isn't that > what a Posix shell would do -- flush any buffers? > > And why do we get EPIPE in the recipe in this bug, anyway? I'd like > to understand better at least one situation where we get EPIPE while > the data received before that still matters. In the recipe, we pipe "git log" to "head -n 10", where Eshell handles the actual piping. (I don't think Eshell's presence here is actually necessary to see this bug, though it's probably the simplest way to reproduce it in Emacs.) "git log" produces a bunch of output that gets sent to Eshell's process filter. That filter eventually calls 'process-send-string' on the "head" process, forwarding all of git's stdout to head's stdin. Immediately after that, head sees that it's already gotten 10 lines of input, so it exits. "git log" doesn't know that yet, so it sends another batch of text to Eshell's process filter, which again gets passed to 'process-send-string'. This time around though, the pipe to head's stdin has been closed, so we get an EPIPE. Currently, Emacs deactivates the head process, but because of how the timings worked out, all this happens *before* Eshell's process filter for head ever runs. As a result, Emacs never see the output that head produced. Thinking about this more, my previous comment that the output from the head process is in an internal buffer in Emacs probably isn't accurate. That *could* happen, but in some cases, we may not have called 'read' yet, so the data could still be in the OS's buffer. (I'd have to write some test cases to be 100% sure of all this, but it follows from the manpages.)
X-Loop: help-debbugs@HIDDEN Subject: bug#79079: 31.0.50; Piped command output is sometimes lost in Eshell Resent-From: Paul Eggert <eggert@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 24 Jul 2025 16:34:02 +0000 Resent-Message-ID: <handler.79079.B79079.17533747875382 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 79079 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: jporterbugs@HIDDEN, mail@HIDDEN, 79079 <at> debbugs.gnu.org Received: via spool by 79079-submit <at> debbugs.gnu.org id=B79079.17533747875382 (code B ref 79079); Thu, 24 Jul 2025 16:34:02 +0000 Received: (at 79079) by debbugs.gnu.org; 24 Jul 2025 16:33:07 +0000 Received: from localhost ([127.0.0.1]:57935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ueysU-0001Ok-T2 for submit <at> debbugs.gnu.org; Thu, 24 Jul 2025 12:33:07 -0400 Received: from mail.cs.ucla.edu ([131.179.128.66]:57712) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eggert@HIDDEN>) id 1ueysR-0001O2-NJ for 79079 <at> debbugs.gnu.org; Thu, 24 Jul 2025 12:33:04 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id D36923C010841; Thu, 24 Jul 2025 09:32:57 -0700 (PDT) Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP id bo75J6jOgE5c; Thu, 24 Jul 2025 09:32:57 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id AACF33C01084E; Thu, 24 Jul 2025 09:32:57 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu AACF33C01084E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1753374777; bh=gFVlrMy1T1oZE8VsSZTu/Gf7VXZ0XckeFmBKshfugOY=; h=Message-ID:Date:MIME-Version:To:From; b=kiTYNSo6Df64g48+wD4Fpz3CZGFcHjn2PSzy9JpA7y+8CsGXGPdg6+N+nmqQhUKB7 lMcnNfcgwvfOfM5NbXwdbjVWpfxLaEMOrPqHfj9ts2tn2DB778PK+ufawnIMSH2jij D2rQravNVSHC2XHCg0UL46zpa8iCMXEOs2cy1VSm6Z1DAgJcovKoywjK3uwAhdKxDr rYpnr+aHhS5pBRWoLRijHPuumlSEzH/R9gGczBnwJYBLUiQdvJN/r6thKBPxbsvCw+ L4zKMMpJ6MN/N+rHhm4lpOX3zcdspLKSgkkUbL59x7+fo2DsbwYQ9UJ2PonT8mh44R oDlDAPnfDFwIQ== X-Virus-Scanned: amavis at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id uTcmKDeaCr1h; Thu, 24 Jul 2025 09:32:57 -0700 (PDT) Received: from penguin.cs.ucla.edu (unknown [47.154.30.222]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id 8C1323C010841; Thu, 24 Jul 2025 09:32:57 -0700 (PDT) Message-ID: <52775838-303f-429c-bc25-31cf683e8a4d@HIDDEN> Date: Thu, 24 Jul 2025 09:32:57 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird References: <87pldr5iza.fsf@HIDDEN> <26784dc3-a846-b880-a023-c3e7d8da3399@HIDDEN> <f48fb759-2a23-19be-5a76-6d2f32f35478@HIDDEN> <864iv26tkk.fsf@HIDDEN> <fa47910e-efad-4b4d-b56c-f0f47d6085b8@HIDDEN> <86cy9p63j0.fsf@HIDDEN> Content-Language: en-US From: Paul Eggert <eggert@HIDDEN> Organization: UCLA Computer Science Department In-Reply-To: <86cy9p63j0.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 2025-07-24 07:56, Eli Zaretskii wrote: >> Not sure what you man by that, but I suspect it wouldn't handle the >> scenario Jim describes, where the other process closes its end of the >> pipe but keeps running. Emacs shouldn't assume that EPIPE means the >> other process has died or has closed any pipes other than the one Emacs >> got EPIPE on. > I guess I'm confused: if the other process closed its end of the pipe, > why do we care about the stuff we have in our buffers that wasn't yet > piped to that other process? I could well be the confused one, but the scenario I was concerned about is when we are running the process for some reason other than the fact that we are piping to it. For example, we have another pipe to the same process. In that case we shouldn't deactivate the entire process (i.e., turn off all output and input for it) merely because one of its pipes closed.
X-Loop: help-debbugs@HIDDEN Subject: bug#79079: 31.0.50; Piped command output is sometimes lost in Eshell Resent-From: Jim Porter <jporterbugs@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 24 Jul 2025 16:48:01 +0000 Resent-Message-ID: <handler.79079.B79079.17533756709343 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 79079 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN>, Paul Eggert <eggert@HIDDEN> Cc: mail@HIDDEN, 79079 <at> debbugs.gnu.org Received: via spool by 79079-submit <at> debbugs.gnu.org id=B79079.17533756709343 (code B ref 79079); Thu, 24 Jul 2025 16:48:01 +0000 Received: (at 79079) by debbugs.gnu.org; 24 Jul 2025 16:47:50 +0000 Received: from localhost ([127.0.0.1]:58004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uez6k-0002Qc-7w for submit <at> debbugs.gnu.org; Thu, 24 Jul 2025 12:47:50 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:54772) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <jporterbugs@HIDDEN>) id 1uez6h-0002QK-9D for 79079 <at> debbugs.gnu.org; Thu, 24 Jul 2025 12:47:48 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-23dea2e01e4so15920465ad.1 for <79079 <at> debbugs.gnu.org>; Thu, 24 Jul 2025 09:47:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753375661; x=1753980461; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=B0WUqShwQnffKK3L2i1fyYtwuwMJkk0DxXV0/YbmFxY=; b=i/9bkCo5+l/fLoLY3pE31x7sqPjuNx3pB8Yv9QpR1RRpdVVNShvg8SLfiG0bxiPXnZ NSYyUe79oBU5JqK60ZVB86Cyvl4e8ggG7ppOb+u/T5tteFyrfRJTOCXO6dUN3K3GxMUu gu6RqaZ+L/NpmrLl4/8qShNY13IUaQNeEu7ZOiZEGnD2yjJvioEDPQqV/JVSN6cUdgj4 o1jD/J/PnijP1Mlv5Sw1VA/GbfZ1rxMpLBlkw4Q3J2uBGP7tnSKkbdffCgHoAhP1V9Vk BHAkt3saHK7TabGAtTGuxxsYYYRbQCfTljrRfFjzud+rqaSk5qktZ3pF/wnhsU5Tu62r lAJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753375661; x=1753980461; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=B0WUqShwQnffKK3L2i1fyYtwuwMJkk0DxXV0/YbmFxY=; b=RI9WrYTSc3aa6sCDMyXotsr76j4L4ejKxZa01Vwii3j5eb6sS+EyRIninh9aEOO2vn bt1fwhGl7ievfnYNPELWFKpSwiA4+ar9xaEgNiYd0DwORVl3L1WCSaW7UoqvEYKYx1Yo KxMWYDlg0PJTRcRcGJrxotcpJkK1nbBdFxvLTNNwzht7oe9OGtzQvNun8G4fueLf7AtZ dOHBAE0/u5sEfoLdBZ0hv8UymQ8iwCS26bIhuk+sg2nht5c1PSJSppAJ4FmHkdXgFqhm xIAQXJum07M1x8ld6XSUeMRv1KZhV8Ps1LbxZ8AKSfUU/VqmqC+e/r6i1IZtH/VV/kPt qcYQ== X-Forwarded-Encrypted: i=1; AJvYcCVgTtEMeJWQ3SGoQs24NfKsXIhBxbd3PahInMk2bOACWLrI+4OYjPIpdKYvB9MLn+QXoTqUmg==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yy2j20dRh/LHia5KqUFAX2zu0igG+OMfkvM0+nsxVs7qTzG9Hhi t9c2ifMaqvSW25aZnDswdtHZeqv7ww/ii90Iv4YF+N0Z51z5bIpF4NUT X-Gm-Gg: ASbGnctoB7Yei5c39vdMWZx98fevNRfIf4BR9BxYW9MUzrueVSEq9MfJAwxGmdgh2pH ifHvPt6RGUttsAvGFZDYv0Gux6L5CU+zLHtF4laYiyCpk2ijjYX9gltdjzraqJGPPJzWWLcQXfF Cf6lbAUa8kxust1+b121RXEe6a+hMqbUVv+81Ob5vpcgpmEibuLWKAFGtUrj3J8kMrMzCBiXpuZ Yf5+USJuPLl7aEmJ01jEAaGtHxYx6K1Ui+le786PwUtC8rrnnD7deG+TXRSyvPKxKn6sby5oakq 9ZPF9S4c6OjLnntE3opI3IkQiEIy7YDqEYSC+ida5T8fg5V7Kq6mMT1RN00K7fe4Mx45Gp7Lh1U RQ/y6z2Pl1SSGm4ygxXad/m13xAfjZhwEAkBINMkI7VyVQfyKZ0o/bhZeMSmRruMQcb3Xmbm5+9 9AufkmkZ8y/zik X-Google-Smtp-Source: AGHT+IF4iLn2NsuCsnN26mAxU5Mrp4R4PDJNeMdQEmvNe0wKFOdw5KA7u/spUZVILwXptIApTEkv3g== X-Received: by 2002:a17:902:e943:b0:235:ec11:f0ee with SMTP id d9443c01a7336-23f9814207bmr98484715ad.14.1753375660834; Thu, 24 Jul 2025 09:47:40 -0700 (PDT) Received: from [192.168.1.2] (syn-076-168-144-128.res.spectrum.com. [76.168.144.128]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-23fa48f0616sm19305855ad.159.2025.07.24.09.47.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Jul 2025 09:47:40 -0700 (PDT) Message-ID: <00b54c14-a767-c2ff-cc97-a4478b32ebfb@HIDDEN> Date: Thu, 24 Jul 2025 09:47:41 -0700 MIME-Version: 1.0 Content-Language: en-US References: <87pldr5iza.fsf@HIDDEN> <26784dc3-a846-b880-a023-c3e7d8da3399@HIDDEN> <f48fb759-2a23-19be-5a76-6d2f32f35478@HIDDEN> <864iv26tkk.fsf@HIDDEN> <fa47910e-efad-4b4d-b56c-f0f47d6085b8@HIDDEN> <86cy9p63j0.fsf@HIDDEN> From: Jim Porter <jporterbugs@HIDDEN> In-Reply-To: <86cy9p63j0.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 7/24/2025 7:56 AM, Eli Zaretskii wrote: >> From: Paul Eggert <eggert@HIDDEN> >> >> Not sure what you man by that, but I suspect it wouldn't handle the >> scenario Jim describes, where the other process closes its end of the >> pipe but keeps running. Emacs shouldn't assume that EPIPE means the >> other process has died or has closed any pipes other than the one Emacs >> got EPIPE on. > > I guess I'm confused: if the other process closed its end of the pipe, > why do we care about the stuff we have in our buffers that wasn't yet > piped to that other process? We could have a situation where a process closes stdin, but we still haven't read everything (or flushed our buffers) for that process's stdout.
X-Loop: help-debbugs@HIDDEN Subject: bug#79079: 31.0.50; Piped command output is sometimes lost in Eshell Resent-From: Jim Porter <jporterbugs@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 24 Jul 2025 17:06:02 +0000 Resent-Message-ID: <handler.79079.B79079.175337675814166 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 79079 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Paul Eggert <eggert@HIDDEN>, Eli Zaretskii <eliz@HIDDEN> Cc: mail@HIDDEN, 79079 <at> debbugs.gnu.org Received: via spool by 79079-submit <at> debbugs.gnu.org id=B79079.175337675814166 (code B ref 79079); Thu, 24 Jul 2025 17:06:02 +0000 Received: (at 79079) by debbugs.gnu.org; 24 Jul 2025 17:05:58 +0000 Received: from localhost ([127.0.0.1]:58072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uezOI-0003gQ-0w for submit <at> debbugs.gnu.org; Thu, 24 Jul 2025 13:05:58 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:51497) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <jporterbugs@HIDDEN>) id 1uezOF-0003gA-R6 for 79079 <at> debbugs.gnu.org; Thu, 24 Jul 2025 13:05:56 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-234f17910d8so11345025ad.3 for <79079 <at> debbugs.gnu.org>; Thu, 24 Jul 2025 10:05:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753376750; x=1753981550; darn=debbugs.gnu.org; h=in-reply-to:from:references:cc:to:content-language:subject :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=U7xLHS29Vu0y6kqXcaMDvvzr+Lbwi1Z+1E5ScBNjoRw=; b=eXdG5lJk3P1tvc780qEU7ZUp1gVw3BTxa5ct9pO3ugX2iWEesZWwJMKUz9Q6Hu2+oc Kp3/47qCTZhaZRdnzM6ucXPIgVVIGjGSwnCM9QNCMwuwLmao7TBCNpqnfNdIKXvgTXWu Wy4JxIDJwjVP5wHA0ebS+IcxAC8vFMtat3gVFUVokY8bZrO5bEjAjmnp+hbdI6rPIqmu eSN3Sl/JRplBGCmspWrVXR+UKiIu1CgxhNHbWClyA4qX3IFcoN/ixexOi2hvUZl+pMMA DcO6+zQmI00afJYTHu4g15l2BjIlaAi/j5C52rtN7gHpKntJPKTFXNh4Iy1ePTknbIP5 kdgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753376750; x=1753981550; h=in-reply-to:from:references:cc:to:content-language:subject :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=U7xLHS29Vu0y6kqXcaMDvvzr+Lbwi1Z+1E5ScBNjoRw=; b=vENPJL1VXlwMkFDjfJWjL6fs4M9eFzrD75kM+A6D2tP3BldJYWzYe9wfBSTTA1fWkK cGgUTqP/u0JJSDdRSH6UxvSg3wtb2nwIyDFna9ZSmXhbrbyG7SGO9bOq2u+Xrir7DDMR Dq1PLiMtKaMl2EZY+tPpPIfLfI4Ww4NgNq1YSmtTH9E8oRoROJ8FiHWkQRTCQGT8Uv9W +Vb4XQVNOcLjUDsURAZNjDHMjmgzOsdg2MzLbf7AX/O3/UxZwqYbRQpXS7phK1egtPG2 Pt/PZBh4isAElI9dgqJFifzyJlzdCOVUxo2+9nuZYhGe1MqvWccmnkijjkvUVoNydJK7 NJfA== X-Forwarded-Encrypted: i=1; AJvYcCVVjtY+cREBFPkgt9exuOFekQsnhEMnRbyEh+RjUvcIGpu6BJzsxrQtbZdRJmG9KcPYlyl+7g==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzyHOtKPllyDFtr3wAqXA4pTKXxKYgDXXr3t5HUSysM68OWf/7P dhwcrtXbZRJ+Mf0oAIJ8HLWinD+N526X0edtOY1qS5tuGLjHF0wYIRAT X-Gm-Gg: ASbGnct79ZetWapqVj4g4rl7atpGVFeypg2u2m2hu/QAgUH/houkTInVCi+tawEuI8a mlRV0H56kiT93TyBcYtBAk85FHHzT1Kr9wd5FsTAeP9yxgTVImA6jzeBCItwyfr8W1xUH06MtZH 5Fu59OlezD9k8LYJPT/vR+tDemM6Qd9kZwlu5EFuUrOd/xmrwhf8IwFV/G8yHawZRpyQsOUMzOW YM+nMzqrWNYMW3LtaWNCBpE7y+qVFykwbuTeQkyC3XU1j2AhDxEdNhwGwB/wTjj5DrZtPGgw42y aJlYEx9LWJfuUVKPzcrce4Lrcp6bqHIo6XWITPTQH1/hemppNjqYyVxuEWDOZaiGzF7TE+CVGBk tIMunWTyieG8cYKoU25tCOkf3W5EPXv/fKLWXJswxU/4XXzgzdOH8BVtZt+FaU60vi1/hmqOU6l qMxrjX8l8r0icg X-Google-Smtp-Source: AGHT+IGAiFsceMHoL2Ua4N9CaJJKjaFJpLQ4L0HFi9FyuRt++WalB8WVWjPS1fVkscuEyR+3iXQYcw== X-Received: by 2002:a17:903:298c:b0:23e:3bdf:e3bd with SMTP id d9443c01a7336-23f9819fea6mr131196645ad.22.1753376749572; Thu, 24 Jul 2025 10:05:49 -0700 (PDT) Received: from [192.168.1.2] (syn-076-168-144-128.res.spectrum.com. [76.168.144.128]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-23fa48dbfccsm19784655ad.138.2025.07.24.10.05.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Jul 2025 10:05:48 -0700 (PDT) Content-Type: multipart/mixed; boundary="------------2iLZLqIsWPUC81bBXeoxQtTo" Message-ID: <f480d60f-c454-380d-13d1-4e550b56e8a1@HIDDEN> Date: Thu, 24 Jul 2025 10:05:50 -0700 MIME-Version: 1.0 Content-Language: en-US References: <87pldr5iza.fsf@HIDDEN> <26784dc3-a846-b880-a023-c3e7d8da3399@HIDDEN> <f48fb759-2a23-19be-5a76-6d2f32f35478@HIDDEN> <864iv26tkk.fsf@HIDDEN> <fa47910e-efad-4b4d-b56c-f0f47d6085b8@HIDDEN> From: Jim Porter <jporterbugs@HIDDEN> In-Reply-To: <fa47910e-efad-4b4d-b56c-f0f47d6085b8@HIDDEN> X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------2iLZLqIsWPUC81bBXeoxQtTo Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/24/2025 6:52 AM, Paul Eggert wrote: > On 2025-07-23 22:34, Eli Zaretskii wrote: >>> Date: Wed, 23 Jul 2025 11:06:24 -0700 >>> From: Jim Porter<jporterbugs@HIDDEN> > >>> In process.c, >>> when we write to a process, we handle EPIPE errors by calling >>> 'deactivate_process'. However, that can lead to us dropping any data >>> written*by* that process, since we don't call the process's filter >>> function for any remaining output still in our internal buffer. >>> >>> I think in this case, we'd just want to let the rest of our code handle >>> deactivating the process in the usual way. That helps fix this bug, plus >>> I think it makes sense in general. If a process closes stdin, I believe >>> we'd get the EPIPE error, but that process might want to continue >>> working (though it does mean that you could only interact with that >>> process via signaling it). > > Yes, that makes sense. Thanks for checking. Then I think the attached diff would be close to what we want, with a few caveats. (The original diff was just the smallest change that seemed to fix the problem so that Daniel could try it out.) This diff changes things so that when we get an EPIPE, we close our end of the pipe (the 'WRITE_TO_SUBPROCESS' fd). I don't know if we need to do anything special for PTYs or sockets though. On the Eshell side then, we previously detected EPIPE by checking whether the process had been deactivated. Since that doesn't happen anymore, I changed it so that we always treat an error from 'process-send-string' as though the pipe broke. In practice, this just means that Eshell will think that all future calls to 'process-send-string' would fail too (and so it will send a SIGPIPE signal to the sending process; "git" in the original test case). I'm not totally sure that's right though. Could there be a time when we get an error from 'process-send-string', but we can try calling it again later? --------------2iLZLqIsWPUC81bBXeoxQtTo Content-Type: text/plain; charset=UTF-8; name="epipe.diff" Content-Disposition: attachment; filename="epipe.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvZXNoZWxsL2VzaC1pby5lbCBiL2xpc3AvZXNoZWxsL2VzaC1p by5lbAppbmRleCAxMWVmYjQyODc5OS4uOWNjNmE4MzdiMzAgMTAwNjQ0Ci0tLSBhL2xpc3Av ZXNoZWxsL2VzaC1pby5lbAorKysgYi9saXNwL2VzaGVsbC9lc2gtaW8uZWwKQEAgLTc0NCwx NSArNzQ0LDE2IEBAIGVzaGVsbC1vdXRwdXQtb2JqZWN0LXRvLXRhcmdldAogICAoY29uZGl0 aW9uLWNhc2UgZXJyCiAgICAgICAocHJvY2Vzcy1zZW5kLXN0cmluZyB0YXJnZXQgb2JqZWN0 KQogICAgIChlcnJvcgotICAgICA7OyBJZiBgcHJvY2Vzcy1zZW5kLXN0cmluZycgcmFpc2Vz IGFuIGVycm9yIGFuZCB0aGUgcHJvY2VzcyBoYXMKLSAgICAgOzsgZmluaXNoZWQsIHRyZWF0 IGl0IGFzIGEgYnJva2VuIHBpcGUuICBPdGhlcndpc2UsIGp1c3QgcmUtcmFpc2UKLSAgICAg OzsgdGhlIHNpZ25hbC4gIE5PVEU6IFdoZW4gcnVubmluZyBFbWFjcyBpbiBiYXRjaCBtb2Rl Ci0gICAgIDs7IChlLmcuIGR1cmluZyByZWdyZXNzaW9uIHRlc3RzKSwgRW1hY3MgY2FuIGFi b3J0IGR1ZSB0byBTSUdQSVBFCi0gICAgIDs7IGhlcmUuICBNYXliZSBgcHJvY2Vzcy1zZW5k LXN0cmluZycgc2hvdWxkIGhhbmRsZSBTSUdQSVBFIGV2ZW4KLSAgICAgOzsgaW4gYmF0Y2gg bW9kZSAoYnVnIzY2MTg2KS4KLSAgICAgKGlmIChwcm9jZXNzLWxpdmUtcCB0YXJnZXQpCi0g ICAgICAgICAoc2lnbmFsIChjYXIgZXJyKSAoY2RyIGVycikpCi0gICAgICAgKHNpZ25hbCAn ZXNoZWxsLXBpcGUtYnJva2VuIChsaXN0IHRhcmdldCkpKSkpCisgICAgIDs7IE5PVEU6IFdo ZW4gcnVubmluZyBFbWFjcyBpbiBiYXRjaCBtb2RlIChlLmcuIGR1cmluZyByZWdyZXNzaW9u CisgICAgIDs7IHRlc3RzKSwgRW1hY3MgY2FuIGFib3J0IGR1ZSB0byBTSUdQSVBFIGhlcmUu ICBNYXliZQorICAgICA7OyBgcHJvY2Vzcy1zZW5kLXN0cmluZycgc2hvdWxkIGhhbmRsZSBT SUdQSVBFIGV2ZW4gaW4gYmF0Y2ggbW9kZQorICAgICA7OyAoYnVnIzY2MTg2KS4KKworICAg ICA7OyBGSVhNRTogVGhpcyB1c2VkIHRvIHNpZ25hbCBgZXNoZWxsLXBpcGUtYnJva2VuJyBv bmx5IHdoZW4gdGhlCisgICAgIDs7IHByb2Nlc3Mgd2FzIGRlYWQsIHNvIHRoYXQgdHJhbnNp ZW50IGVycm9ycyBpbgorICAgICA7OyBgcHJvY2Vzcy1zZW5kLXN0cmluZycgd291bGRuJ3Qg Y2xvc2Ugb3VyIEVzaGVsbCBwaXBlLiAgQXJlIHRoZXJlCisgICAgIDs7IGV2ZW4gdHJhbnNp ZW50IGVycm9ycyBsaWtlIHRoYXQsIG9yIHdoYXQgSSBvdmVydGhpbmtpbmcgdGhpbmdzPwor ICAgICAoc2lnbmFsICdlc2hlbGwtcGlwZS1icm9rZW4gKGxpc3QgdGFyZ2V0KSkpKQogICBv YmplY3QpCiAKIChjbC1kZWZtZXRob2QgZXNoZWxsLW91dHB1dC1vYmplY3QtdG8tdGFyZ2V0 IChvYmplY3QKZGlmZiAtLWdpdCBhL3NyYy9wcm9jZXNzLmMgYi9zcmMvcHJvY2Vzcy5jCmlu ZGV4IGU2MWVjNDI1ZjdlLi41NmQ4NmIyNTkyZSAxMDA2NDQKLS0tIGEvc3JjL3Byb2Nlc3Mu YworKysgYi9zcmMvcHJvY2Vzcy5jCkBAIC02ODczLDEwICs2ODczLDEzIEBAIHNlbmRfcHJv Y2VzcyAoTGlzcF9PYmplY3QgcHJvYywgY29uc3QgY2hhciAqYnVmLCBwdHJkaWZmX3QgbGVu LAogCQl9CiAJICAgICAgZWxzZSBpZiAoZXJybm8gPT0gRVBJUEUpCiAJCXsKLQkJICBwLT5y YXdfc3RhdHVzX25ldyA9IDA7Ci0JCSAgcHNldF9zdGF0dXMgKHAsIGxpc3QyIChRZXhpdCwg bWFrZV9maXhudW0gKDI1NikpKTsKLQkJICBwLT50aWNrID0gKytwcm9jZXNzX3RpY2s7Ci0J CSAgZGVhY3RpdmF0ZV9wcm9jZXNzIChwcm9jKTsKKwkJICAvKiBGSVhNRTogSGFuZGxlIFBU WSB0b28/ICBXaGF0IGFib3V0IHNvY2tldHM/ICBBbmQKKwkJICAgICByZW1vdmUgdGhpcyBk ZWJ1ZyBzdGF0ZW1lbnQuICAqLworCQkgIEFVVE9fU1RSSU5HIChmb3JtYXQsICJbZGVidWdd IEVQSVBFOiAlUyIpOworCQkgIENBTExOIChGbWVzc2FnZSwgZm9ybWF0LCBwLT5uYW1lKTsK KworCQkgIGNsb3NlX3Byb2Nlc3NfZmQoJnAtPm9wZW5fZmRbV1JJVEVfVE9fU1VCUFJPQ0VT U10pOworCQkgIHAtPm91dGZkID0gLTE7CiAJCSAgZXJyb3IgKCJQcm9jZXNzICVzIG5vIGxv bmdlciBjb25uZWN0ZWQgdG8gcGlwZTsgY2xvc2VkIGl0IiwKIAkJCSBTREFUQSAocC0+bmFt ZSkpOwogCQl9Cg== --------------2iLZLqIsWPUC81bBXeoxQtTo--
X-Loop: help-debbugs@HIDDEN Subject: bug#79079: 31.0.50; Piped command output is sometimes lost in Eshell Resent-From: Paul Eggert <eggert@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 24 Jul 2025 18:51:01 +0000 Resent-Message-ID: <handler.79079.B79079.17533830399083 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 79079 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jim Porter <jporterbugs@HIDDEN>, Eli Zaretskii <eliz@HIDDEN> Cc: mail@HIDDEN, 79079 <at> debbugs.gnu.org Received: via spool by 79079-submit <at> debbugs.gnu.org id=B79079.17533830399083 (code B ref 79079); Thu, 24 Jul 2025 18:51:01 +0000 Received: (at 79079) by debbugs.gnu.org; 24 Jul 2025 18:50:39 +0000 Received: from localhost ([127.0.0.1]:58436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uf11a-0002MP-Jt for submit <at> debbugs.gnu.org; Thu, 24 Jul 2025 14:50:38 -0400 Received: from mail.cs.ucla.edu ([131.179.128.66]:49468) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eggert@HIDDEN>) id 1uf11X-0002MA-W4 for 79079 <at> debbugs.gnu.org; Thu, 24 Jul 2025 14:50:36 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 1EF4B3C010841; Thu, 24 Jul 2025 11:50:30 -0700 (PDT) Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP id etccXVa_FtUa; Thu, 24 Jul 2025 11:50:30 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id EADD13C01084E; Thu, 24 Jul 2025 11:50:29 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu EADD13C01084E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1753383030; bh=5NP0jfxxRgL2ycvPQMjXIVbOKUiwr/VlIEDckG9yz1k=; h=Message-ID:Date:MIME-Version:To:From; b=C5AXcscKFZF6jpJdKo6MgZK4blM4RxIYZ512vRHfhqgxlbeyT5h8hoeH57fG96qNZ UFYGcGKcXuM+JdNhQaSddl2qV8khW4H0WDwP44SeExa/NpJcSU2ZFEAiQot9HmfUV3 Gkg6itkPYzUrSEhvGPHy/LB5nrYJbaSyKpCITFLiWtTZKxHluruGwkDRs9t58u5Qye OnLdELh3m7yptgPQqgB2mykkQ+JuZa8ml/NmgerjKxboYa3rc90zK4tahPrFHLN1P+ If0moW+mR6dt5PLuNe4ldKbW71Al/jut48flhma6saLdIsyzSf67VdqapZobBw2H2T 1Ag5u68Sb3thA== X-Virus-Scanned: amavis at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id tRD6K7EyeCmX; Thu, 24 Jul 2025 11:50:29 -0700 (PDT) Received: from penguin.cs.ucla.edu (unknown [47.154.30.222]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id CBDEC3C010841; Thu, 24 Jul 2025 11:50:29 -0700 (PDT) Message-ID: <5673863a-5825-4fa9-b428-62872978eb81@HIDDEN> Date: Thu, 24 Jul 2025 11:50:29 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird References: <87pldr5iza.fsf@HIDDEN> <26784dc3-a846-b880-a023-c3e7d8da3399@HIDDEN> <f48fb759-2a23-19be-5a76-6d2f32f35478@HIDDEN> <864iv26tkk.fsf@HIDDEN> <fa47910e-efad-4b4d-b56c-f0f47d6085b8@HIDDEN> <f480d60f-c454-380d-13d1-4e550b56e8a1@HIDDEN> Content-Language: en-US From: Paul Eggert <eggert@HIDDEN> Organization: UCLA Computer Science Department In-Reply-To: <f480d60f-c454-380d-13d1-4e550b56e8a1@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 2025-07-24 10:05, Jim Porter wrote: > Could there be a time when we get an error from 'process-send-string', > but we can try calling it again later? Not if it's an EPIPE failure. EPIPE means the connection is permanently down. I don't offhand know of any failure for writing to a pipe where retrying would make sense, other than EAGAIN and EWOULDBLOCK which the code is already dealing with. Can process-send-string write to other file types? If so, there are other possibilities where retrying might work, e.g., ENOSPC for write to a regular file, ENETDOWN for sendto to a network socket.
X-Loop: help-debbugs@HIDDEN Subject: bug#79079: 31.0.50; Piped command output is sometimes lost in Eshell Resent-From: Jim Porter <jporterbugs@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 24 Jul 2025 19:07:01 +0000 Resent-Message-ID: <handler.79079.B79079.175338398713121 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 79079 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Paul Eggert <eggert@HIDDEN>, Eli Zaretskii <eliz@HIDDEN> Cc: mail@HIDDEN, 79079 <at> debbugs.gnu.org Received: via spool by 79079-submit <at> debbugs.gnu.org id=B79079.175338398713121 (code B ref 79079); Thu, 24 Jul 2025 19:07:01 +0000 Received: (at 79079) by debbugs.gnu.org; 24 Jul 2025 19:06:27 +0000 Received: from localhost ([127.0.0.1]:58489 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1uf1Gs-0003PZ-T8 for submit <at> debbugs.gnu.org; Thu, 24 Jul 2025 15:06:27 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:46520) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <jporterbugs@HIDDEN>) id 1uf1Gq-0003PF-Fg for 79079 <at> debbugs.gnu.org; Thu, 24 Jul 2025 15:06:25 -0400 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-31332cff2d5so1355567a91.1 for <79079 <at> debbugs.gnu.org>; Thu, 24 Jul 2025 12:06:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753383978; x=1753988778; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=I0kGz93840N3we4+qGD2XexCZr+L0kC51gS5BgOeEko=; b=kvqsOuOch5Ci/01ADCvMlelbljRwUcaW0hSuGDmnxoRBoTO8k8sYhRo41WNvjZoF2Y O9MSjtq+vLhCmQXj//i5MUMvL/cps84eWFOoe5Qz+kKqVfk4HPXm+Q7+FOZvr5OL4WMn vd23kLJHmmEhUssxW8ZD3dcnXhv1IqdAzzni0N0NVWQ/hLnEFXH+V+rcrowgk4EvezCh AOF4mvpyrI8bLkbbI7d5N3u7O9SJoXo9iJgR7sjO3BtKh4vYAOQHCqwtklD1a31SAa4/ W2NUf6az6+J7BA3E7e0rBZHYQglK4lmKRgk9qaN/fZoRO8XGCxn/0RtgRFS+PmOX6kn3 VcvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753383978; x=1753988778; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=I0kGz93840N3we4+qGD2XexCZr+L0kC51gS5BgOeEko=; b=LRtPtsoLS/nZGUf0sJEZrQYDMAZLNcef8Py4y2+KcH2x1Alkl4Q9tabA5KMPeKKPtC fvkfTV2NSxG0EhVlOWWR/iuLzv9b6Xp9GaQSw8ZY0pGTKvKGqevk/2p1PJ++1rB/apnu zQd2kRyN4NDuU7rF1Ara2ikpWnD0n0089RSuhBdb2DBMGRQ7fIpztE85mYUTpayU4xqs RXxcxp/6UzTN/i7VRhPLnM2QUhupAX3RitLzBE+TbEhnzIgbST3JgWpV47ztfpXpZk+x wTsKGZfGsh3Ye2qAKBnFg1o1ClAyrzX0UFp74ZeXgaJlT1WpFlEniDS9Spk6X5TsFKPZ DmyQ== X-Forwarded-Encrypted: i=1; AJvYcCWQbOT7jOzcH1MyMvizo5i876Nfpj5RLmVasnnh95EXkQH1PJy0unHgMOjZdpNM5QpCkJxUXw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyLhciW/HdMMY3DndbgcvJTmvXBCahvJsmdCY1ukc5DKEPeHX6H PFRGH3lmLocadKk77QXMzZOQUlt5fUurD/WDpVQlUR6kvQvyjlZrLwDX X-Gm-Gg: ASbGncu089j+Bfejh6wbMaCg0yHqIGn7NCGidgCm5h8B35qlBxk2gMnqAYtOZ9wijK5 g2m8O3yyHb2fhHfGOkZX+uWMgtfJXq9Knig/fxlNjkaOd9O1xizQgpX6Oc5i2TZVEH4ERx7fuJe KhIx04Wz2x0BeTTOCy7KK8S6Oe7w6Vba+U1grVJAPE76Z+KZaN54Ep22IcQC3HiDdRAj0sxftWm +/C9r6uiMk9t+QnKI77nt6N+uq3QdVQdeM1XOekR4NqGXGhU4df8BMwXdlLX354xe9rgwmFzjCF EmrR/FfuRrsRPirnVLef/ra5knvmSfvafBUhJEqrsCzo3eBdGAtEgO3qhgDkcgES76wtfiDfPX8 FTs6xA5PE1BKyAh63sVph+KgbyDWaGSKfZGOFyS1HM2Gb2A+3EhXE5vZ2hLFB+TRd3AE3lzZ1Dr ke7g== X-Google-Smtp-Source: AGHT+IGWbuCEs1Scy/mOp7k5gH3JK3MExSEu8t1RRj0zRkIXJEYUgT6ITAGQaXdJp6L4RwtgrOYnyg== X-Received: by 2002:a17:90b:2709:b0:311:b0d3:865 with SMTP id 98e67ed59e1d1-31e507fe806mr9681690a91.32.1753383977836; Thu, 24 Jul 2025 12:06:17 -0700 (PDT) Received: from [192.168.1.2] (syn-076-168-144-128.res.spectrum.com. [76.168.144.128]) by smtp.googlemail.com with ESMTPSA id 98e67ed59e1d1-31e66269935sm1922068a91.8.2025.07.24.12.06.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Jul 2025 12:06:17 -0700 (PDT) Message-ID: <a4e67125-ea37-6341-2d3b-2d62c8bb58b2@HIDDEN> Date: Thu, 24 Jul 2025 12:06:16 -0700 MIME-Version: 1.0 Content-Language: en-US References: <87pldr5iza.fsf@HIDDEN> <26784dc3-a846-b880-a023-c3e7d8da3399@HIDDEN> <f48fb759-2a23-19be-5a76-6d2f32f35478@HIDDEN> <864iv26tkk.fsf@HIDDEN> <fa47910e-efad-4b4d-b56c-f0f47d6085b8@HIDDEN> <f480d60f-c454-380d-13d1-4e550b56e8a1@HIDDEN> <5673863a-5825-4fa9-b428-62872978eb81@HIDDEN> From: Jim Porter <jporterbugs@HIDDEN> In-Reply-To: <5673863a-5825-4fa9-b428-62872978eb81@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 7/24/2025 11:50 AM, Paul Eggert wrote: > On 2025-07-24 10:05, Jim Porter wrote: >> Could there be a time when we get an error from 'process-send-string', >> but we can try calling it again later? > > Not if it's an EPIPE failure. EPIPE means the connection is permanently > down. Right. I was just wondering if there might be some use in signaling different types of errors in send_process; one for transient errors (if there are any we care about), and one for permanent errors (which look to be most/all of them). > I don't offhand know of any failure for writing to a pipe where retrying > would make sense, other than EAGAIN and EWOULDBLOCK which the code is > already dealing with. > > Can process-send-string write to other file types? If so, there are > other possibilities where retrying might work, e.g., ENOSPC for write to > a regular file, ENETDOWN for sendto to a network socket. For Eshell, we only support writing to regular processes, though I suppose with enough effort you could probably construct an Eshell command that writes to a socket. Of course, for something like ENETDOWN, Eshell would probably need some special handling to retry sending the same data again, instead of just skipping over it.
X-Loop: help-debbugs@HIDDEN Subject: bug#79079: 31.0.50; Piped command output is sometimes lost in Eshell Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 25 Jul 2025 06:43:01 +0000 Resent-Message-ID: <handler.79079.B79079.175342573832566 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 79079 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jim Porter <jporterbugs@HIDDEN> Cc: mail@HIDDEN, eggert@HIDDEN, 79079 <at> debbugs.gnu.org Received: via spool by 79079-submit <at> debbugs.gnu.org id=B79079.175342573832566 (code B ref 79079); Fri, 25 Jul 2025 06:43:01 +0000 Received: (at 79079) by debbugs.gnu.org; 25 Jul 2025 06:42:18 +0000 Received: from localhost ([127.0.0.1]:60664 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ufC8I-0008TB-9B for submit <at> debbugs.gnu.org; Fri, 25 Jul 2025 02:42:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51024) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1ufC8D-0008Sd-7m for 79079 <at> debbugs.gnu.org; Fri, 25 Jul 2025 02:42:15 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1ufC86-0004BB-6a; Fri, 25 Jul 2025 02:42:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=EVPPsW+HIIpieqcl9xJ55ZqDRMjKSa5zQz9tPxSdnN0=; b=eDGZNpzqqaza mZO9TF6XKafjkGjNP7o0ZumH93b4pNG8dRpbNstcim+8hG8TQqsgBmYW1dX3Dr7c46hAJtanXyQuM pJM29kz6/TcAUaNJUJy+O5IXqwjHlgyyK8YE1tbhgCJ79oaMlRxMAVYFhkzMOdRIPMDMoi3faB8R4 zJLhxCJ1W1E8NvzlLqfrIJKTwm4CbuF2ExmmVbxFkQoTeroXxYA8mn3vVakDgYgmfzv90jGk2000N 8UoXSzFoz1H+Muh1BHUmh6ZW8A9XQRAfmQfkNDtFuPFarlVxEYRmOHQfdbSRvpxqZaqef9KEImy3V 7XP8aZBXhVUf2n7/uD0Jzg==; Date: Fri, 25 Jul 2025 09:42:02 +0300 Message-Id: <868qkc6abp.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <f480d60f-c454-380d-13d1-4e550b56e8a1@HIDDEN> (message from Jim Porter on Thu, 24 Jul 2025 10:05:50 -0700) References: <87pldr5iza.fsf@HIDDEN> <26784dc3-a846-b880-a023-c3e7d8da3399@HIDDEN> <f48fb759-2a23-19be-5a76-6d2f32f35478@HIDDEN> <864iv26tkk.fsf@HIDDEN> <fa47910e-efad-4b4d-b56c-f0f47d6085b8@HIDDEN> <f480d60f-c454-380d-13d1-4e550b56e8a1@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Date: Thu, 24 Jul 2025 10:05:50 -0700 > Cc: mail@HIDDEN, 79079 <at> debbugs.gnu.org > From: Jim Porter <jporterbugs@HIDDEN> > > --- a/src/process.c > +++ b/src/process.c > @@ -6873,10 +6873,13 @@ send_process (Lisp_Object proc, const char *buf, ptrdiff_t len, > } > else if (errno == EPIPE) > { > - p->raw_status_new = 0; > - pset_status (p, list2 (Qexit, make_fixnum (256))); > - p->tick = ++process_tick; > - deactivate_process (proc); > + /* FIXME: Handle PTY too? What about sockets? And > + remove this debug statement. */ > + AUTO_STRING (format, "[debug] EPIPE: %S"); > + CALLN (Fmessage, format, p->name); > + > + close_process_fd(&p->open_fd[WRITE_TO_SUBPROCESS]); > + p->outfd = -1; > error ("Process %s no longer connected to pipe; closed it", > SDATA (p->name)); > } Why do we need to emit a message about EPIPE, when we will immediately signal an error with the same information? The message will not be seen by users except if they look in *Messages*.
X-Loop: help-debbugs@HIDDEN Subject: bug#79079: 31.0.50; Piped command output is sometimes lost in Eshell Resent-From: Jim Porter <jporterbugs@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 25 Jul 2025 17:17:02 +0000 Resent-Message-ID: <handler.79079.B79079.175346379127986 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 79079 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii <eliz@HIDDEN> Cc: mail@HIDDEN, eggert@HIDDEN, 79079 <at> debbugs.gnu.org Received: via spool by 79079-submit <at> debbugs.gnu.org id=B79079.175346379127986 (code B ref 79079); Fri, 25 Jul 2025 17:17:02 +0000 Received: (at 79079) by debbugs.gnu.org; 25 Jul 2025 17:16:31 +0000 Received: from localhost ([127.0.0.1]:35841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ufM22-0007HJ-Vz for submit <at> debbugs.gnu.org; Fri, 25 Jul 2025 13:16:31 -0400 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]:61785) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <jporterbugs@HIDDEN>) id 1ufM1w-0007Gk-MV for 79079 <at> debbugs.gnu.org; Fri, 25 Jul 2025 13:16:29 -0400 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-b3bcb168fd5so2311241a12.3 for <79079 <at> debbugs.gnu.org>; Fri, 25 Jul 2025 10:16:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753463779; x=1754068579; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=Fd5X46XuYtvFyV6BxztWT9VVImU3UOYe6oohxrumNGI=; b=HJRAFZdAetxlE8gPYc1wdQkUUvvxvwmqFlcXmUmpLpvsJgQf1oR4fde1CnqFa9/y8g 40pvq4FWD+ftTsXCCm9eOSm0N9Ssws+2dS5yf9lguMUczjb1/PWfFRUMXsLhi+MPVYxg 2hoWG/LfSISfQ7VHygy954kEbAMSFCHUq/auKVHAkwgdKNxTUmU3nUOKg/ZmgZiBGb/+ G6o0URM+A5UKa19anaTRzFkOi96O0jwmvLT5w9shc2sqvzODgk1dC7EgZnp7ywQojaER AWMgWFVYx15MROlZL2EyFg05ZBHu5wugKLg4ZSUGP2ZJ9VqYjw2moFbZ1FS7dRofwYCz EoCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753463779; x=1754068579; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Fd5X46XuYtvFyV6BxztWT9VVImU3UOYe6oohxrumNGI=; b=ncB2Gja6fK79egWbS41n+V+mIrz88uQa3RwIE71Li0nJZDuCGmDow6qFORqxX7+oTj 4GJ2/BH8dkP+x0gokgtpeQtseBZDTsmaHfyHajP018fh+iLNEk3g6NqWUjqMNtLREd/7 t6YRuVphk8Wmi68CNKMJQchvxn0QhlIYBLvXwLSviGpx6Z35IE+zmKcL96QRorKR+X+v DoIV76eZiwwlNo9sQT07H6qGjLdvOVecNtcfwagvYR/qzD56RBIC4b/ypgiiYYDOojaP GkjSfE+qRJeFq251NF+8XKpBysKGHEF6anf4zso/8FRGKK63uEYOhUJQkSFZ7kUhL6Gw RIVw== X-Forwarded-Encrypted: i=1; AJvYcCU83fcgRx4XNL0oQl9fbnj2xVNFDMMOUktf4lc7kExip4gzDfkdw4Njjnqrj39aWuvoozU1vw==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yw0ycmZ7E9Lm7Eb+YBv1/jCP46J5YsPOA4jid8RGU1LcWDMPvfV xJW74sR1BEA1rk464zHnBrQDXi5l6NRU6AFuAqsFpzI9ZQ3hd50e4sJ7 X-Gm-Gg: ASbGnctMiIcAilG6VKKY53C3fJaH15Y9ZAaT5mEAOnb6z8Apw5W8Jp9dG21Z4JPUsDn GTQGUpJhS5aI7NjMd+kHR4kpB9MXHCdJwy57SuqRQ9BE8cGmRKOXg45O/RmPOjHhIAJEmt544Em MFr/bscY8GWQt92kX2LMOy1nzSuhe2wKrnMnjAX5UqOB2Z85g5jD9lnEWN+a93LVDwP9UNpoZm3 YFR0Xy2Qf7qYq4MMSTJ7sjqsPF8ZfUa2EtsVRF19stsEDn1R33obrGCivY8IB6iQgQUZ1Ux1jB1 rPvNxfFkN0W/Y5KkmQkfCZYl0bz/E1KeLIiT7/CsXRhCkhYUpXbzYLKEFmbylg7pObTbINvj4KK s7VXE9S6va3GLc9jmyYmlMH4ISQ8eNrfj3/Lx2uR12TUbM7uqLVBVkpZv3i2pIRoAGQ9Wk12hFr 02cw== X-Google-Smtp-Source: AGHT+IEhfdL985VCm9m/7/INSUmkncoX86FYE4+dx2FXb/OBnHalUGW0bj1byhOW47Zb2jZgVvaWZA== X-Received: by 2002:a17:902:fc8f:b0:23d:dcba:a467 with SMTP id d9443c01a7336-23fb3051091mr44463125ad.4.1753463778485; Fri, 25 Jul 2025 10:16:18 -0700 (PDT) Received: from [192.168.1.2] (syn-076-168-144-128.res.spectrum.com. [76.168.144.128]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-23fbe30ae0bsm1691795ad.18.2025.07.25.10.16.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Jul 2025 10:16:18 -0700 (PDT) Message-ID: <28e961c2-9a5c-4e9d-bb14-0ff30cb042ef@HIDDEN> Date: Fri, 25 Jul 2025 10:16:19 -0700 MIME-Version: 1.0 Content-Language: en-US References: <87pldr5iza.fsf@HIDDEN> <26784dc3-a846-b880-a023-c3e7d8da3399@HIDDEN> <f48fb759-2a23-19be-5a76-6d2f32f35478@HIDDEN> <864iv26tkk.fsf@HIDDEN> <fa47910e-efad-4b4d-b56c-f0f47d6085b8@HIDDEN> <f480d60f-c454-380d-13d1-4e550b56e8a1@HIDDEN> <868qkc6abp.fsf@HIDDEN> From: Jim Porter <jporterbugs@HIDDEN> In-Reply-To: <868qkc6abp.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 7/24/2025 11:42 PM, Eli Zaretskii wrote: > Why do we need to emit a message about EPIPE, when we will immediately > signal an error with the same information? The message will not be > seen by users except if they look in *Messages*. It's just a debug statement for development/testing so that it's clear when Emacs runs this block. Since this is a timing-related issue, it's hard to guarantee that we hit this condition. While I'm working on this, I can then check *Messages* to be sure my new code ran and did the right thing. I'll remove the Fmessage call before merging.
X-Loop: help-debbugs@HIDDEN Subject: bug#79079: 31.0.50; Piped command output is sometimes lost in Eshell Resent-From: Eli Zaretskii <eliz@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sat, 26 Jul 2025 10:16:01 +0000 Resent-Message-ID: <handler.79079.B79079.17535249483009 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 79079 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jim Porter <jporterbugs@HIDDEN> Cc: mail@HIDDEN, eggert@HIDDEN, 79079 <at> debbugs.gnu.org Received: via spool by 79079-submit <at> debbugs.gnu.org id=B79079.17535249483009 (code B ref 79079); Sat, 26 Jul 2025 10:16:01 +0000 Received: (at 79079) by debbugs.gnu.org; 26 Jul 2025 10:15:48 +0000 Received: from localhost ([127.0.0.1]:40210 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ufbwR-0000lF-9M for submit <at> debbugs.gnu.org; Sat, 26 Jul 2025 06:15:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55500) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1ufbwO-0000S5-DT for 79079 <at> debbugs.gnu.org; Sat, 26 Jul 2025 06:15:45 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1ufbwG-0000fg-T3; Sat, 26 Jul 2025 06:15:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=KV7fWo2Lt6PX9PHY7tUrX5N+HKpCJQcyD7RLZR/lRww=; b=YHB+FVCQjEZY z19NStkpxd/WtKvDjCFkHgptdj7n4U3Eva1sLoZTbeJ9a5JfcT6/e4c/qYvdlXetMblp55uyE97Xg t/gWiL23eSUKrCx1DXGiKOYMXhIkstWG9JnjITFnqJla9njbpGKC3732/YFWYVreulOn3bhgH0xoS R9jEFUpAuCOHTpYfJpbG5gKIrbRwMgenVnEPIeXQBujiFaYFtpJ2hrJkMO5akywQN89+CkJWevbZ0 W5V6CnwGLCfbfSe69RaSqeoe212MLpyroq6xQYFORAzSK2aRW2GLV5raXUGGoGB1LHuS+MCELoZSM 0F/Nv1c/qNgGW9O83Prvbw==; Date: Sat, 26 Jul 2025 13:15:21 +0300 Message-Id: <864iuz1cna.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> In-Reply-To: <79cd6ad9-f939-6b8a-ebe0-83b0b0475b62@HIDDEN> (message from Jim Porter on Thu, 24 Jul 2025 08:52:16 -0700) References: <87pldr5iza.fsf@HIDDEN> <26784dc3-a846-b880-a023-c3e7d8da3399@HIDDEN> <f48fb759-2a23-19be-5a76-6d2f32f35478@HIDDEN> <864iv26tkk.fsf@HIDDEN> <79cd6ad9-f939-6b8a-ebe0-83b0b0475b62@HIDDEN> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Date: Thu, 24 Jul 2025 08:52:16 -0700 > Cc: mail@HIDDEN, 79079 <at> debbugs.gnu.org > From: Jim Porter <jporterbugs@HIDDEN> > > On 7/23/2025 10:34 PM, Eli Zaretskii wrote: > > What about calling the filter with the data we still have? Isn't that > > what a Posix shell would do -- flush any buffers? > > > > And why do we get EPIPE in the recipe in this bug, anyway? I'd like > > to understand better at least one situation where we get EPIPE while > > the data received before that still matters. > > In the recipe, we pipe "git log" to "head -n 10", where Eshell handles > the actual piping. (I don't think Eshell's presence here is actually > necessary to see this bug, though it's probably the simplest way to > reproduce it in Emacs.) > > "git log" produces a bunch of output that gets sent to Eshell's process > filter. That filter eventually calls 'process-send-string' on the "head" > process, forwarding all of git's stdout to head's stdin. Immediately > after that, head sees that it's already gotten 10 lines of input, so it > exits. "git log" doesn't know that yet, so it sends another batch of > text to Eshell's process filter, which again gets passed to > 'process-send-string'. This time around though, the pipe to head's stdin > has been closed, so we get an EPIPE. Currently, Emacs deactivates the > head process, but because of how the timings worked out, all this > happens *before* Eshell's process filter for head ever runs. As a > result, Emacs never see the output that head produced. So calling the filter of the "head"s process when we get EPIPE should fix that, no?
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.