1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

Merge pull request #13100 from NaN-git/fix-musl-deadlock

allocate SimpleLogger before forking
This commit is contained in:
Eelco Dolstra 2025-04-28 09:01:06 +02:00 committed by GitHub
commit 5565679b45
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -202,6 +202,7 @@ static int childEntry(void * arg)
pid_t startProcess(std::function<void()> fun, const ProcessOptions & options) pid_t startProcess(std::function<void()> fun, const ProcessOptions & options)
{ {
auto newLogger = makeSimpleLogger();
ChildWrapperFunction wrapper = [&] { ChildWrapperFunction wrapper = [&] {
if (!options.allowVfork) { if (!options.allowVfork) {
/* Set a simple logger, while releasing (not destroying) /* Set a simple logger, while releasing (not destroying)
@ -210,7 +211,7 @@ pid_t startProcess(std::function<void()> fun, const ProcessOptions & options)
~ProgressBar() tries to join a thread that doesn't ~ProgressBar() tries to join a thread that doesn't
exist. */ exist. */
logger.release(); logger.release();
logger = makeSimpleLogger(); logger = std::move(newLogger);
} }
try { try {
#ifdef __linux__ #ifdef __linux__