Re: SIGCHLD not received

2012-07-25 Thread Denis Bilenko
On Tue, Jul 24, 2012 at 8:56 PM, Marc Lehmann schm...@schmorp.de wrote: in loop_fork() you call Hm, right. Can you try the CVS version of libev? That one doesn't rely on this check anymore, and will probably just work (the test in the signal handler relied on int being atomic and was

Re: SIGCHLD not received

2012-07-24 Thread Denis Bilenko
On Mon, Jul 23, 2012 at 1:24 PM, Marc Lehmann schm...@schmorp.de wrote: Hmm, it's been a long time - what exactly is the behaviour I am supposed to see from the program without the sleep, and what behaviour do you get? Here's the program with sleep removed (no further changes necessary), just

Re: SIGCHLD not received

2012-07-23 Thread Denis Bilenko
On Thu, May 31, 2012 at 10:32 PM, Denis Bilenko denis.bile...@gmail.com wrote: On Thu, May 31, 2012 at 9:13 PM, Marc Lehmann schm...@schmorp.de wrote: The SIGCHLD is received, of course, but then libev fails to notify the child watcher in a timely manner. Instead, it delays the notification

Re: SIGCHLD not received

2012-07-23 Thread Marc Lehmann
On Mon, Jul 23, 2012 at 12:15:57PM +0400, Denis Bilenko denis.bile...@gmail.com wrote: There's another issue, in which libev does lose the signal forever. To reproduce it, remove sleep(1) from the latest test program. Hmm, it's been a long time - what exactly is the behaviour I am supposed

Re: SIGCHLD not received

2012-05-31 Thread Marc Lehmann
On Thu, May 31, 2012 at 12:39:24AM +0400, Denis Bilenko denis.bile...@gmail.com wrote: - not use the event loop in the main process; use waitpid() - fail on first iteration You can see it here: https://gist.github.com/gists/2838734 The SIGCHLD is received, of course, but then libev

Re: SIGCHLD not received

2012-05-31 Thread Denis Bilenko
On Thu, May 31, 2012 at 9:13 PM, Marc Lehmann schm...@schmorp.de wrote: The SIGCHLD is received, of course, but then libev fails to notify the child watcher in a timely manner. Instead, it delays the notification by 60 seconds (MAX_BLOCKTIME). I'll have a look, however, from looking

Re: SIGCHLD not received

2012-05-30 Thread Denis Bilenko
On Wed, May 30, 2012 at 1:29 AM, Marc Lehmann schm...@schmorp.de wrote: 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.

Re: SIGCHLD not received

2012-05-30 Thread Marc Lehmann
On Wed, May 30, 2012 at 02:55:52PM +0400, Denis Bilenko denis.bile...@gmail.com 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, and when I run it after the patch

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