This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH,Hurd] Fix hang on fork
- From: Samuel Thibault <samuel dot thibault at gnu dot org>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: libc-alpha at sourceware dot org, bug-hurd at gnu dot org
- Date: Thu, 28 Aug 2014 20:31:57 +0200
- Subject: Re: [PATCH,Hurd] Fix hang on fork
- Authentication-results: sourceware.org; auth=none
- References: <20140827230625 dot GW3343 at type dot youpi dot perso dot aquilenet dot fr> <20140828182108 dot 799512C3A5D at topped-with-meat dot com>
Roland McGrath, le Thu 28 Aug 2014 11:21:08 -0700, a écrit :
> Fix comment formatting, put space before paren,
Right, I really need to teach my editor to do the comments properly
automatically...
> write a ChangeLog entry.
This is what I had put, is some information still missing?
* sysdeps/mach/hurd/fork.c (__fork): Lock SS->lock around __proc_dostop() call.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
sysdeps/mach/hurd/fork.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sysdeps/mach/hurd/fork.c b/sysdeps/mach/hurd/fork.c
index ab11bab..1f0b8a3 100644
--- a/sysdeps/mach/hurd/fork.c
+++ b/sysdeps/mach/hurd/fork.c
@@ -122,9 +122,13 @@ __fork (void)
ports_locked = 1;
+ /* Keep our SS locked while stopping other threads, so they don't get a
+ chance to be having it locked in the copied space. */
+ __spin_lock (&ss->lock);
/* Stop all other threads while copying the address space,
so nothing changes. */
err = __proc_dostop (_hurd_ports[INIT_PORT_PROC].port, ss->thread);
+ __spin_unlock (&ss->lock);
if (!err)
{
stopped = 1;
--
tg: (9a079e2..) t/fork_ss_hang (depends on: baseline)