Hi,
I've reviewed the finalizer patch and made some changes to ensure that
it works correctly if pipe creation or thread creation fail.
Thread creation fails in an out-of-memory scenario, so this part can be
verified by running Guile's test-out-of-memory test case. You'll need a
libgc built
Ludovic Courtès skribis:
> Ludovic Courtès skribis:
>
>> While working on a fix for this issue (finalizer pipe shared between
>> parent and child process), I found the ‘sleep_pipe’ of the main thread
>> is also shared between the parent and its child.
>
> Here’s a patch that fixes the problem
Hi Andrew,
Andrew Whatson skribis:
> * libguile/finalizers.c (finalization_pipe): Initialize.
> (reset_finalization_pipe): Factored out.
> (start_finalization_thread): Create the pipe immediately before
> launching the thread. Ensure the pipe is cleaned up if thread creation
> fails. Update
Hi,
Mathieu Othacehe skribis:
> Those two finalizer threads share the same pipe. When we try to
> stop the finalizer thread in Shepherd, right before forking a new
> process, we send a '\1' byte to the finalizer pipe.
>
> 1 write(6, "\1", 1
>
>
> which is received by (line 183597):
>
>
Ludovic Courtès skribis:
> While working on a fix for this issue (finalizer pipe shared between
> parent and child process), I found the ‘sleep_pipe’ of the main thread
> is also shared between the parent and its child.
Here’s a patch that fixes the problem as exposed by the reproducer.
Hi!
Mathieu Othacehe skribis:
> Those two finalizer threads share the same pipe. When we try to
> stop the finalizer thread in Shepherd, right before forking a new
> process, we send a '\1' byte to the finalizer pipe.
>
> 1 write(6, "\1", 1
>
>
> which is received by (line 183597):
>
>
Hey Ludo,
> We should be able to reproduce it with much simpler tests then, right?
> Like maybe “while : ; do herd restart guix-daemon ; done” or similar?
Well I tried that without success. Then I had a closer look to the
strace log.
Turns out there are two concurrent "finalizer" threads:
Hi,
Mathieu Othacehe skribis:
> When running "gui-installed-desktop-os-encrypted" test, Shepherd seems
> to deadlock when restarting "guix-daemon". This can happen at different
> stages:
>
> * In "umount-cow-store" procedure, just before finishing the install.
>
> * During "set-http-proxy"
Hi Mathieu,
Mathieu Othacehe writes:
> This is not always reproducible. In order to gather some information, I
> created a Shepherd "strace" service that logs what's happening in
> Shepherd itself (patch attached).
> +(define strace-service-type
> + (shepherd-service-type
> + 'strace
> +
> 183605:1 futex(0x7f17981e79d0, FUTEX_WAIT, 271, NULL
I think this is caused by a "pthread_join", most probably the one in
"stop_finalization_thread" that is called right before forking a new
process. The fact that we hang here probably means that the finalizer
thread itself is hanging,
10 matches
Mail list logo