Bug with signal delivery after fork.

Chris Shoemaker c.shoemaker at cox.net
Wed Jan 16 12:51:23 CET 2008


On Wed, Jan 16, 2008 at 03:48:52AM +0100, Marc Lehmann wrote:
> On Tue, Jan 15, 2008 at 12:54:59PM -0500, Chris Shoemaker <c.shoemaker at cox.net> wrote:
> > I've narrowed this down considerably by tracing both good and bad
> > executions and comparing.  I'll comment the differences in the code:
> 
> Your test program is still buggy:
> 
> >     ev_default_fork();
> >     ev_loop(loop, EVLOOP_NONBLOCK);
> >     ev_signal_init (&signal_watcher, signal_cb, SIGHUP);
> >     ev_signal_start (loop, &signal_watcher);
> 
> You have to start your watcher before looping, otherwise it does return when
> no other watchers are active.

*sigh*

But since I may not _want_ to start watch signals in the child until much
later, I don't have a watcher I want to start, unless I make one up, just
for the purposes of avoiding this race.  I think I'll just stick with
patching the race out of ev.c.  Thanks.

-chris 



More information about the libev mailing list