g_slice_alloc hangs on child process on fork
When a fork
is called other threads are doing memory allocations, g_slice might have a mutex locked at that point. So any new allocation in the child process of the fork, then will hang in g_slice_alloc
.
G_SLICE=always-malloc
does not suffer of the issue.
Here is an example of program that would hang.
If it does not reproduces, try increasing THREAD_N
and/or ALLOC_N
.