From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Newsgroups: gmane.lisp.guile.bugs Subject: bug#43066: Hang when forking new process. Date: Tue, 11 May 2021 12:43:33 +0200 Message-ID: <87mtt11rfu.fsf@gnu.org> References: <87r1rsh6vc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38564"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cc: 43066-done@debbugs.gnu.org To: Mathieu Othacehe Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Tue May 11 13:24:03 2021 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lgQUd-0009wE-Sq for guile-bugs@m.gmane-mx.org; Tue, 11 May 2021 13:24:03 +0200 Original-Received: from localhost ([::1]:33712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgQUc-0007r8-UM for guile-bugs@m.gmane-mx.org; Tue, 11 May 2021 07:24:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgPru-0000wd-Mn for bug-guile@gnu.org; Tue, 11 May 2021 06:44:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51822) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgPru-0003FX-AK for bug-guile@gnu.org; Tue, 11 May 2021 06:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lgPru-00064a-8X for bug-guile@gnu.org; Tue, 11 May 2021 06:44:02 -0400 Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-To: bug-guile@gnu.org Resent-Date: Tue, 11 May 2021 10:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 43066 X-GNU-PR-Package: guile Mail-Followup-To: 43066@debbugs.gnu.org, ludo@gnu.org, othacehe@gnu.org Original-Received: via spool by 43066-done@debbugs.gnu.org id=D43066.162072982123300 (code D ref 43066); Tue, 11 May 2021 10:44:02 +0000 Original-Received: (at 43066-done) by debbugs.gnu.org; 11 May 2021 10:43:41 +0000 Original-Received: from localhost ([127.0.0.1]:35134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgPrZ-00063k-GS for submit@debbugs.gnu.org; Tue, 11 May 2021 06:43:41 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33550) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgPrX-00063X-Uv for 43066-done@debbugs.gnu.org; Tue, 11 May 2021 06:43:40 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:45098) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgPrS-0002zu-MT for 43066-done@debbugs.gnu.org; Tue, 11 May 2021 06:43:34 -0400 Original-Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=41916 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgPrS-0007DL-DM; Tue, 11 May 2021 06:43:34 -0400 In-Reply-To: <87r1rsh6vc.fsf@gnu.org> (Mathieu Othacehe's message of "Thu, 27 Aug 2020 09:42:47 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:10044 Archived-At: Hi Mathieu, Mathieu Othacehe skribis: >>>From 004c0c78c9c21c48b38d76b5d7b356b40c8e5a4a Mon Sep 17 00:00:00 2001 > From: Mathieu Othacehe > 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=E2=80=99.