Re: [bug] Bash crash when malloc is called in a signal handler.

Chet Ramey <[email protected]> Fri, 6 Mar 2026 10:40:25 -0500
Newsgroups gmane.comp.shells.bash.bugs
Organization ITS, Case Western Reserve University
Message-ID <[email protected]>
On 3/6/26 2:05 AM, fengfei.xi wrote:

> Glibc version: 2.36-9+deb12u10
> 
> Bash Version: 5.2
> Patch Level: 15
> Release Status: release
> 
> Description:
> 
> We have encountered several very low-probability Bash coredump issues in production.

Thanks for the report. This can be a problem when bash attempts to save the
shell history after receiving a fatal signal during malloc().

It's an issue that occurs with the glibc malloc; the bash malloc can deal
with multiple malloc calls during signal handling and isn't susceptible.

Chet
-- 
``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-----

wmMEABEIACMWIQR8ATX7CIqvbGbGULm7WGnwZOp0qwUCaar1aQUDAAAAAAAKCRC7WGnwZOp0q1QT
AJ4/3PtTOETEulJbOmwZc1KXny1G0ACfTPWDCTup7e7EBPppCEUxxDo6kI4=
=+7xi
-----END PGP SIGNATURE-----