This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/10354] posix_spawn should use vfork() in more cases than presently
- From: "bugdal at aerifal dot cx" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 28 May 2014 04:24:02 +0000
- Subject: [Bug libc/10354] posix_spawn should use vfork() in more cases than presently
- Auto-submitted: auto-generated
- References: <bug-10354-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=10354
--- Comment #8 from Rich Felker <bugdal at aerifal dot cx> ---
Using clone with CLONE_VM and a new stack/start-function solves most of the
insurmountable problems with vfork that make it unsafe, but there are still a
number of considerations that come from sharing memory. In particular, you must
ensure that no signal handlers run in the child while it's sharing memory with
the parent, and the parent must be responsible for freeing the child's stack,
and thus must synchronize with the execve call in the child.
I have a working implementation in musl which solves these problems (it uses
clone with CLONE_VM for all posix_spawn operations) if anyone is interested in
looking at it and doing something similar for glibc.
--
You are receiving this mail because:
You are on the CC list for the bug.