From: "Ludovic Courtès" <ludo@gnu.org>
To: Mathieu Othacehe <othacehe@gnu.org>
Cc: 43066-done@debbugs.gnu.org
Subject: bug#43066: Hang when forking new process.
Date: Tue, 11 May 2021 12:43:33 +0200 [thread overview]
Message-ID: <87mtt11rfu.fsf@gnu.org> (raw)
In-Reply-To: <87r1rsh6vc.fsf@gnu.org> (Mathieu Othacehe's message of "Thu, 27 Aug 2020 09:42:47 +0200")
Hi Mathieu,
Mathieu Othacehe <othacehe@gnu.org> skribis:
>>From 004c0c78c9c21c48b38d76b5d7b356b40c8e5a4a Mon Sep 17 00:00:00 2001
> From: Mathieu Othacehe <othacehe@gnu.org>
> Date: Thu, 27 Aug 2020 09:16:55 +0200
> Subject: [PATCH] Close finalization pipe after forking.
>
> When forking, the finalization pipe file descriptors are
> inherited. If the child process spawns a finalization thread, it will
> use a copy of its parent finalization pipe file descriptors.
>
> Hence, if the parent tries to stop its finalization thread, by forking
> another process for instance, it may stop the child finalization thread
> and hang forever for its own finalization thread to stop.
>
> Fix it by closing the finalization pipe file descriptor copies in the
> child right after forking and opening a new pipe by calling
> scm_init_finalizer_thread.
>
> * libguile/finalizers.c (scm_i_finalizer_post_fork): New function.
> * libguile/finalizers.c (scm_i_finalizer_post_fork): Declare it.
> * libguile/posix.c (scm_fork): Call it in the child process, right after forking.
Apologies for overlooking this patch!
This was fixed differently in 5a281e35f4a5ae78fbcf10591d9358bec8f0bee0,
which is in 3.0.7.
Thanks,
Ludo’.
prev parent reply other threads:[~2021-05-11 10:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-27 7:42 bug#43066: Hang when forking new process Mathieu Othacehe
2021-05-11 10:43 ` Ludovic Courtès [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mtt11rfu.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=43066-done@debbugs.gnu.org \
--cc=othacehe@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).