[BusyBox] Bug#212764: 2 race conditions in init implementation

Guillaume Morin guillaume at morinfr.org
Mon Oct 6 14:11:52 UTC 2003


Dans un message du 06 oct à 14:16, Vladimir N. Oleynik écrivait :
> Ah! You compared with verions have child_handler()? :-0
> We remove child handler ~ 15 day ago.

Well, my patch was sent through the Debian BTS against a specific
version of busybox. I never looked in your CVS. If you removed
child_handler(), there should not be any races left.

I still think that checking return values is good practice.

> >It is the same for the first race. If the handler is called before
> >wait(), wait() will block.
> wait MUST block!

Well, not if the handler has been called before. Otherwise, it will
block forever. 

Yes, I know you removed it but that would be nice if you could answer in
the context.

> This code point must have wait(), not waitpid()

Why ? The only difference is you might reap zombies at random ... Is that
what you want ?? Why not keeping child_handler() then ?

> You have found problems in yours patch for this letter!

Whatever that means, I have found a problem in my interpretation of the
first problem. But The patch is still correct and _will_ work even if
you have removed child_handler(). But I admit it is not needed anymore.

> >Testing return codes is good
> This code is difficult for testing for correctness.

Right but testing nothing is certainly not the way to go.


Guillaume Morin <guillaume at morinfr.org>

                       Sauvez un arbre, mangez un castor

More information about the busybox mailing list