|
From: Nicholas N. <nj...@ca...> - 2004-02-11 00:11:42
|
On Wed, 11 Feb 2004, Tom Hughes wrote:
> > Very strange -- a trivial system() is tripping Valgrind up on my machine,
> > yet this is the first I've seen of it on the current HEAD?
>
> I wonder if system is implemented using vfork rather than fork?
>
> The NPTL C library implements fork using clone, and as part of
> the NPTL/TLS changes I made valgrind handle that, but it may be
> that vfork is also being done using clone with slightly different
> flags and valgrind isn't catching that.
>
> Try stracing the test program without valgrind and see what
> system calls the system() is doing.
Full trace attached. The interesting bit is:
rt_sigaction(SIGINT, {SIG_IGN}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_IGN}, {SIG_DFL}, 8) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
clone(child_stack=0, flags=CLONE_PARENT_SETTID|0x11, [7814], <ignored>) = 7814
wait4(7814, [WIFEXITED(s) && WEXITSTATUS(s) == 0], 0, NULL) = 7814
rt_sigaction(SIGINT, {SIG_DFL}, NULL, 8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL}, NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
--- SIGCHLD (Child exited) @ 0 (0) ---
exit_group(0) = ?
Um, hmm.
N |