On Mon, 9 Sep 2002, Richard Hilditch wrote:

> One of the user space daemons in our product (www.snapix.com) receives
> Streams messages using getmsg and starts Linux processes (using fork, fork,
> execv). Under stress (starting tens of processes per second) we have seen
> that getmsg sometimes returns with -1 (as expected) but with errno set to
> ECHILD rather than EGAIN.
[...]
> I have taken an strace of the failure (attached). Line 128 shows the failing
> getmsg (SYS_188), however strace thinks it is returning EAGAIN.

>From your strace :

128:SYS_188(0x5, 0xbffff604, 0x400ccac0, 0, 0xbffff620) = -1 EAGAIN
(Resource temporarily unavailable)
129:--- SIGCHLD (Child exited) ---
130:wait4(-1, NULL, WNOHANG, NULL)          = 13583
131:wait4(-1, NULL, WNOHANG, NULL)          = -1 ECHILD (No child
processes)
132:sigreturn()                             = ? (mask now [])

Don't you have a SIGCHLD handler that changes errno ? If the child dies
while the syscall is being executed (or while the program is stopped by
strace), the signal will be handled and errno changed by wait(2) before
the main program can read the value set by the LiS syscall.

HTH

-- 
Jean-Marc Saffroy - Research Engineer - Silicomp Research Institute
mailto:[EMAIL PROTECTED]


_______________________________________________
Linux-streams mailing list
[EMAIL PROTECTED]
http://gsyc.escet.urjc.es/mailman/listinfo/linux-streams

Reply via email to