Subject: bug#79079: 31.0.50; Piped command output is sometimes lost in Eshell

From: Daniel Mendler <[email-masked]>
Date: Wed, 23 Jul 2025 11:55:53 +0200

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