Red Hat Bugzilla – Bug 108016
Problem with vfork in GNU version 3.2.2
Last modified: 2007-04-18 12:58:46 EDT
Description of problem:
Version-Release number of selected component (if applicable):
By using vfork
int main(int argc, char *argv)
Steps to Reproduce:
1.compile the program
2.run the program
GNU C Library stable release version 2.3.2, by Roland McGrath et al.
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
Compiled by GNU CC version 3.2.2 20030222 (Red Hat Linux 3.2.2-5).
Compiled on a Linux 2.4.20 system on 2003-03-13.
GNU libio by Per Bothner
crypt add-on version 2.1 by Michael Glad and others
NPTL 0.29 by Ulrich Drepper
NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Thread-local storage support included.
Report bugs using the `glibcbug' script to <email@example.com>.
Your testcase is ill-formed.
See man vfork:
"except that the behaviour is undefined if the process created by vfork() either
... , or returns from the function in which vfork() was called"
That's exactly what you're trying to do.
The difference between vfork and fork is that vfork provides performance boost
but makes very strong requirements what you can and what you cannot do.