Re: Pipe makes subshell crash with stack overflow

Chet Ramey <[email protected]> Thu, 19 Mar 2026 14:18:39 -0400
Newsgroups gmane.comp.shells.bash.bugs
Organization ITS, Case Western Reserve University
Message-ID <[email protected]>
On 3/19/26 11:15 AM, Manuel Wagesreither wrote:
> Hello all,
> 
> I'm observing a strange error: When a subshell spawned with command substitution uses a pipe, it crashes with a Stack Overflow.
> 
> Hence, the following doesn't work: `var=$( echo hello world | cat - )`
> 
> (More detailed reproducer attached.)
> 
> I'm using GNU bash, version 4.4.19(3)-release (x86_64-pc-msys) on Windows 11. This bash is packaged by a company that provides it as part of their SDK. I'm already in contact with their support but am doing my own research in parallel. They currently seem unable to reproduce.
> 
> Does this problem look familiar to someone?
> 
> I hope it's a known problem that's fixed in a later version, so I could suggest a fix by upgrading the bash.

It's not a known or reproducible problem. I suspect it has something to do
with how msys simulates pipes on Windows.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    [email protected]    http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc (application/pgp-signature, 203 B)
-----BEGIN PGP SIGNATURE-----

wmMEABEIACMWIQR8ATX7CIqvbGbGULm7WGnwZOp0qwUCabw9/wUDAAAAAAAKCRC7WGnwZOp0q8qB
AJ9tXFitj3ezyya0/rnbsD2fTOTzDwCfWfbvCJV4hB2AIMQc7a3AuioafDA=
=tBUP
-----END PGP SIGNATURE-----