public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Samuel Thibault <sthibaul@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] hurd _Fork: Drop duplicate malloc_fork_lock calls
Date: Sun, 11 Jul 2021 17:54:01 +0000 (GMT)	[thread overview]
Message-ID: <20210711175401.8F2633840002@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=83b7008e11f6d149f1926970b7c21cc50ce536ed

commit 83b7008e11f6d149f1926970b7c21cc50ce536ed
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Sun Jul 11 17:51:12 2021 +0000

    hurd _Fork: Drop duplicate malloc_fork_lock calls
    
    This was put in __libc_fork by c32c868ab8b2 ("posix: Add _Fork [BZ #4737]")
    so we need to avoid locking them again in _Fork called by __libc_lock, otherwise
    we deadlock.

Diff:
---
 sysdeps/mach/hurd/_Fork.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/sysdeps/mach/hurd/_Fork.c b/sysdeps/mach/hurd/_Fork.c
index df4ee05faa..75d45d6cad 100644
--- a/sysdeps/mach/hurd/_Fork.c
+++ b/sysdeps/mach/hurd/_Fork.c
@@ -119,7 +119,6 @@ retry:
 	 handlers may use malloc, and the libio list lock has an
 	 indirect malloc dependency as well (via the getdelim
 	 function).  */
-      call_function_static_weak (__malloc_fork_lock_parent);
       _hurd_malloc_fork_prepare ();
 
       newtask = MACH_PORT_NULL;
@@ -588,7 +587,6 @@ retry:
 
       /* Release malloc locks.  */
       _hurd_malloc_fork_parent ();
-      call_function_static_weak (__malloc_fork_unlock_parent);
 
       /* Run things that want to run in the parent to restore it to
 	 normality.  Usually prepare hooks and parent hooks are
@@ -662,7 +660,6 @@ retry:
 
       /* Release malloc locks.  */
       _hurd_malloc_fork_child ();
-      call_function_static_weak (__malloc_fork_unlock_child);
 
       /* Run things that want to run in the child task to set up.  */
       RUN_HOOK (_hurd_fork_child_hook, ());


                 reply	other threads:[~2021-07-11 17:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210711175401.8F2633840002@sourceware.org \
    --to=sthibaul@sourceware.org \
    --cc=glibc-cvs@sourceware.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).