[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: macOS 14 objc `+initialize` forced crash due to fork after thread
From: |
Tom |
Subject: |
Re: macOS 14 objc `+initialize` forced crash due to fork after thread |
Date: |
Mon, 06 May 2024 15:17:58 +0000 |
> It looks like it's the call to setlocale() that creates the auxiliary
> threads, and the call to gettext() that forces the artificial crash.
Yep, that's my understanding.
> So any call to gettext() in the parent process before any fork would be
> sufficient to complete the initialization?
It does appear that way; running the following (a modification of the repro I
put to the `gettext` list):
```
#include <libintl.h>
#include <stdlib.h>
#include <unistd.h>
int main() {
unsetenv("LANG");
setlocale(LC_ALL, "");
gettext("");
if (fork()== 0) {
gettext("test");
}
}
```
causes the issue to no longer trigger. Note that `LANG` needs to be cleared
before the call to `setlocale` to trigger the issue.