On Wed, May 30, 2012 at 5:33 PM, Marc Lehmann <[email protected]> wrote: > On Wed, May 30, 2012 at 02:55:52PM +0400, Denis Bilenko > <[email protected]> wrote: >> Yes, it seems that waitpid() somehow masks or avoids the bug. If I >> apply this small patch to your program it fails - why? > > The test program still forks with an existing loop,
Which is legal, otherwise what's the point of ev_loop_fork and fork watchers if not fork an existing event loop? I think figured why it fails though - the child forked off in subprocess() is short-lived and can die before loop_fork() was actually executed by ev_run(). Merely calling ev_loop_fork() is not enough, but if it's followed by ev_run() (which exits immediately because there are no watchers) then it works. So SIGCHLD was received but it wrote to a pipe end that was soon replaced by another pipe in loop_fork(). _______________________________________________ libev mailing list [email protected] http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev
