SIGCHLD not received

2012-05-29 Thread Denis Bilenko
Hi, I have a weird test case (attached) where SIGCHLD is not being received by libev. I don't quite understand if it's a 1) bug in how I use libev 2) bug in libev itself 3) bug in the OS The work around I found that makes this test pass is to patch libev to start a timer (active only when there

Re: SIGCHLD not received

2012-05-29 Thread Marc Lehmann
On Tue, May 29, 2012 at 04:31:05PM +0400, Denis Bilenko denis.bile...@gmail.com wrote: I have a weird test case (attached) where SIGCHLD is not being received by libev. I don't quite understand if it's a Well, thanks for a simple-to-try test program :) 1) bug in how I use libev This one -

Re: SIGCHLD not received

2012-05-29 Thread Marc Lehmann
On Tue, May 29, 2012 at 05:29:20PM +0200, Gabriel Kerneis kern...@pps.jussieu.fr wrote: I do not understand what you mean here, probably because I never tried to mix fork, pthreads and epoll in a single program. Could you please provide some Oh, it's quite independent of each other, too, i.e.

Re: SIGCHLD not received

2012-05-29 Thread Denis Bilenko
On Tue, May 29, 2012 at 7:12 PM, Marc Lehmann schm...@schmorp.de wrote: This one - your test program forks after initialising the default loop, without calling ev_default_fork. OK, I've fixed the test program to do that and also fixed a fd leak. It takes a bit longer to fail now, but it still

Re: SIGCHLD not received

2012-05-29 Thread Marc Lehmann
On Tue, May 29, 2012 at 09:57:30PM +0400, Denis Bilenko denis.bile...@gmail.com wrote: On Tue, May 29, 2012 at 7:12 PM, Marc Lehmann schm...@schmorp.de wrote: This one - your test program forks after initialising the default loop, without calling ev_default_fork. OK, I've fixed the test

Re: SIGCHLD not received

2012-05-29 Thread Denis Bilenko
On Tue, May 29, 2012 at 10:08 PM, Marc Lehmann schm...@schmorp.de wrote: You also don't call waitpid on your children - can you add error checking to all functions you call, to make sure you really do wait for your children (especially check fork returns)? Most likely you run out of process

Re: SIGCHLD not received

2012-05-29 Thread Marc Lehmann
On Tue, May 29, 2012 at 10:57:31PM +0400, Denis Bilenko denis.bile...@gmail.com wrote: No, it's not that. Attached is the program that checks the error codes and also waits for a child using child watcher. Still fails. Now you changed your program considerably, and I am too lazy/sleepy to