URL: <https://savannah.gnu.org/bugs/?68310>
Summary: Hang on subshell exits
Group: The GNU Bourne-Again SHell
Submitter: None
Submitted: Thu 07 May 2026 08:52:10 AM UTC
Category: None
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Unlocked
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Thu 07 May 2026 08:52:10 AM UTC By: Anonymous
When compiled by GCC 16 with the -flto and -O2 CFLAGS, as well as the
--without-bash-malloc and --disable-nls configure options, Bash hangs forever
when exiting subshells.
The following commands should suffice to reproduce this:
(lfs chroot) root:/# curl -fsSLO
https://ftpmirror.gnu.org/gnu/bash/bash-5.3.tar.gz
(lfs chroot) root:/# sha256sum bash-5.3.tar.gz
0d5cd86965f869a26cf64f4b71be7b96f90a3ba8b3d74e27e8e9d9d5550f31ba
bash-5.3.tar.gz
(lfs chroot) root:/# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/16.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --prefix=/usr --bindir=/usr/bin
--sbindir=/usr/bin --libexecdir=/usr/lib LD=ld --enable-languages=c,c++
--enable-default-pie --enable-default-ssp --enable-host-pie
--enable-targets=all --disable-multilib --disable-bootstrap
--disable-fixincludes --with-system-zlib --with-isl
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.1.0 (GCC)
(lfs chroot) root:/# env
PWD=/
HOME=/home/root
MAKEFLAGS=-j16
TERM=xterm-256color
SHLVL=1
PS1=(lfs chroot) \u:\w\$
PATH=/usr/bin
_=/usr/bin/env
OLDPWD=/bash-5.3
(lfs chroot) root:/# tar xf bash-5.3.tar.gz && cd bash-5.3
(lfs chroot) root:/bash-5.3# env CFLAGS="-O2 -flto" ./configure
--without-bash-malloc --disable-nls &> configure.out
(lfs chroot) root:/bash-5.3# make -j1 &> make.out
(lfs chroot) root:/bash-5.3# ./bash -c '(echo a); echo b'
a
^C
Note that the second echo, the one following the subshell, is never reached.
Also note that although the commands and toolchain above refer to Linux From
Scratch, I've also reproduced this on a plain Arch Linux install.
I'm not certain this is a compiler bug. If you think it is, I'm happy to
redirect this report to GCC.
_______________________________________________________
File Attachments:
{configure,make}.out are from the provided commands.
Name: configure.out Size: 19KiB
<https://file.savannah.gnu.org/file/configure.out?file_id=58562>
Name: make.out Size: 54KiB
<https://file.savannah.gnu.org/file/make.out?file_id=58563>
Name: config.log Size: 799KiB
<https://file.savannah.gnu.org/file/config.log?file_id=58564>
AGPL NOTICE
These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://savannah.gnu.org/source/savane-c36938be85ff6c1b727bc7dd7fd30e48f9142870.tar.gz
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68310>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
