lkml.org 
[lkml]   [1998]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Possible bug in wait4(), 2.1.126-129 ?
i think this is either a mis-understanding, or else a debatable action
on perl's part.

the reason wait4() is returning ESRCH is because there are no child
processes to be reaped. the reason that there are no child processes
to be reaped is because the SIGCHLD action is set to SIG_IGN. this
can be seen in the strace output from cron ...

in this trace pid 6230 is the shell that cron runs. /tmp/j is the
sample
program posted earlier.

...
6230 sigaction(SIGCHLD, {SIG_IGN}, {0x805c1a0, [], 0}) = 0
6230 execve("/tmp/j", ["/tmp/j"], [/* 10 vars */]) = 0
...
6230 fork() = 6231
6230 nanosleep(0xbffffe5c, 0xbffffe5c, 0x400a6b4c, 0x1, 0x804848c
<unfinished ...>
6231 _exit(0) = ?
6230 <... nanosleep resumed> ) = -1 EINTR (Interrupted system
call)
6230 --- SIGCHLD (Child exited) ---
6230 wait4(6231, 0xbffffe70, 0, NULL) = -1 ECHILD (No child processes)
6230 write(2, "wait4: No child processes\n", 26) = 26
6229 <... read resumed> "wait4: No child processes\n", 4096) = 26
...
6230 _exit(0) = ?
6229 --- SIGCHLD (Child exited) ---

this is what i would expect the shell to do, so the question is whether
perl should ensure that SIGCHLD is trapped and handled.

can someone post truss or ktrace output from some other OS to show what
they do please?


jan-simon.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:45    [W:0.089 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site