This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/14499] New: Does posix_spawn invoke atfork handlers / use vfork?
- From: "luto at mit dot edu" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Mon, 20 Aug 2012 22:24:29 +0000
- Subject: [Bug nptl/14499] New: Does posix_spawn invoke atfork handlers / use vfork?
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=14499
Bug #: 14499
Summary: Does posix_spawn invoke atfork handlers / use vfork?
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: nptl
AssignedTo: unassigned@sourceware.org
ReportedBy: luto@mit.edu
CC: drepper.fsp@gmail.com
Classification: Unclassified
The resolution of bug 378 indicates that glibc's (NPTL) posix_spawn calls
atfork handlers. This means that posix_spawn can't use vfork (or fancy clone
options), which makes it slow. (Note that, AFAICT, this behavior is not
documented anywhere, despite being implementation-specified.)
This was apparently true when bug 378 was closed, but it changed in commit
a9f43ef464f71b0d379524b2a6294092332c9a30. The current behavior is bizarre.
See the attached code, which invokes atfork handlers only on the second
posix_spawn call.
IMO the right fix is to never invoke atfork handlers (since presumably nothing
relies on them getting called, since they haven't been reliably called since
2005). That way vfork can be used unconditionally, which is faster.
See also bug 10354, which does not have a resolution that I understand.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.