hurd _Fork: Drop duplicate malloc_fork_lock calls

This was put in __libc_fork by c32c868ab8 ("posix: Add _Fork [BZ #4737]")
so we need to avoid locking them again in _Fork called by __libc_lock, otherwise
we deadlock.
This commit is contained in:
Samuel Thibault 2021-07-11 17:51:12 +00:00
parent 17cef890c9
commit 83b7008e11

View File

@ -119,7 +119,6 @@ retry:
handlers may use malloc, and the libio list lock has an handlers may use malloc, and the libio list lock has an
indirect malloc dependency as well (via the getdelim indirect malloc dependency as well (via the getdelim
function). */ function). */
call_function_static_weak (__malloc_fork_lock_parent);
_hurd_malloc_fork_prepare (); _hurd_malloc_fork_prepare ();
newtask = MACH_PORT_NULL; newtask = MACH_PORT_NULL;
@ -588,7 +587,6 @@ retry:
/* Release malloc locks. */ /* Release malloc locks. */
_hurd_malloc_fork_parent (); _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 /* Run things that want to run in the parent to restore it to
normality. Usually prepare hooks and parent hooks are normality. Usually prepare hooks and parent hooks are
@ -662,7 +660,6 @@ retry:
/* Release malloc locks. */ /* Release malloc locks. */
_hurd_malloc_fork_child (); _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 things that want to run in the child task to set up. */
RUN_HOOK (_hurd_fork_child_hook, ()); RUN_HOOK (_hurd_fork_child_hook, ());