bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Segfault in command substitution child: dispose_temporary_env -> sv_


From: Chet Ramey
Subject: Re: Segfault in command substitution child: dispose_temporary_env -> sv_locale -> libintl_setlocale -> CoreFoundation after fork (macOS)
Date: Thu, 29 Oct 2026 08:49:58 -0400
User-agent: Mozilla Thunderbird

On 10/29/26 5:12 AM, Andreas Schwab wrote:
On Okt 29 2026, Robert Elz wrote:

     Date:        Wed, 28 Oct 2026 17:35:39 +0100
     From:        =?UTF-8?Q?Jakub_Boche=C5=84ski?= <kuba.bochenski@gmail.com>
     Message-ID:  
<CAGiELgqdhNdRa+Y4m1ZH2Kik2L93=Jq=mSz7n_bg5m_hcPR6JQ@mail.gmail.com>

   | On restore, sv_locale calls libintl's setlocale, which on macOS asks
   | CoreFoundation for the preferred languages; CoreFoundation is not usable in
   | the child of a multi-threaded process after fork, and the process crashes.
   | macOS's crash report says so explicitly:

That looks like a macOS bug to me, there's nothing I see in POSIX that
restricts when setlocale() can be called.

In the forked child of a multi-threaded process only async-signal-safe
function can be called, which setlocale isn't required to be.


I might be more sympathetic to this argument if bash had created multiple
threads, or if setlocale() were documented as doing so. As it is, it's
just another macOS quirk to work around.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]