This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/10354] posix_spawn should use vfork() in more cases than presently


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]