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-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 at it,

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

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 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 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: proposal: defer installing SIGCHLD

2012-05-24 Thread Denis Bilenko
On Thu, May 24, 2012 at 6:25 AM, Marc Lehmann schm...@schmorp.de wrote: The real reason why it breaks existing apps is another one though: the behavious is deterministic right now - when you want to do your own signal handling, you e.g. block/ev_default_loop/restore/unblock, and that is much

proposal: defer installing SIGCHLD

2012-05-22 Thread Denis Bilenko
Hi Marc, The patch below defers installing SIGCHLD until the first child watcher is started. Thus, if an application does not use child watchers, libev never installs a SIGCHLD handler. The problem I'm solving with it is this: In gevent 0.x we used libevent which does not reap children. There

Re: proposal: defer installing SIGCHLD

2012-05-22 Thread Denis Bilenko
On Tue, May 22, 2012 at 4:49 PM, Zsbán Ambrus amb...@math.bme.hu wrote: On Tue, May 22, 2012 at 11:21 AM, Denis Bilenko denis.bile...@gmail.com wrote: The patch below defers installing SIGCHLD until the first child watcher is started. Thus, if an application does not use child watchers

patch for ev_loop_destroy()

2012-05-11 Thread Denis Bilenko
It looks like there's a bug in ev_loop_destroy(): when called for a non-default loop, it would stop the signal handler for SIGCHLD, even though the latter belongs to the default loop. The patched below should fix it. --- /home/denis/work/libev-cvs/ev.c 2012-05-10 20:47:37.064383729 +0400 +++

Re: libev release candidate

2012-05-08 Thread Denis Bilenko
On Sun, May 6, 2012 at 11:52 PM, Marc Lehmann schm...@schmorp.de wrote: Hi! Here is a candidate for the next release (ignroe the evrsion number, this is just a temporary file):   http://data.plan9.de/libev-4.11.tar.gz It would be nice to get some compile feedback on this one. If all goes

[PATCH] calculate fudge on win32

2011-06-02 Thread Denis Bilenko
On Fri, Jun 3, 2011 at 12:34 AM, Marc Lehmann schm...@schmorp.de wrote: As for 0, we indeed don't need to care, but introducing this special case would make the timeout values nonproportional to the actual time. And that in turn would destroy the property that adding something to a timeout