Subject: bug#52646: GC thread freeze

From: Ludovic Courtès <[email-masked]>
Date: Tue, 21 Dec 2021 11:16:36 +0100

Hello!

Mathieu Othacehe <[email-masked]> skribis:

> I experiment a strange behaviour with this Guile 3.0.7 process:
> https://git.savannah.gnu.org/cgit/guix/guix-cuirass.git/tree/src/cuirass/scripts/remote-worker.scm.
>
> The process is forking N processes that in turn start 4 threads.

This is happening in this order, right?

POSIX leaves unspecified the behavior of a child process forked from a
multi-threaded process; there could be deadlocks, etc.  ‘primitive-fork’
prints a warning when called from a multi-threaded Guile process.

The solution is for multi-threaded Guile processes to not fork at all,
or to fork only via ‘open-pipe*’, ‘system*’, etc., which are “known
good” (they take care of post-fork handling in the child and call ‘exec’
before anything bad could happen.)

Thanks,
Ludo’.