DragonFly BSD
DragonFly users List (threaded) for 2006-10
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: bmake not killing childrens


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 4 Oct 2006 13:05:24 -0700 (PDT)

:
:>     Our normal 'make' sometimes fails to kill children too.   Now it is
:>     certainly possible for a program to ignore SIGINT, but the real
:>     problem here is probably due to a bug in DragonFly rather than a bug
:>     in make or bmake.
:
:The problem has been reported on other operating systems too. (And I have 
:had the problem with NetBSD's bmake on Linux platform also.)

    I looked at the code, and it doesn't look hard to fix.  The problem is
    this bit:

void
Compat_Run(Lst targs)
{
    GNode         *gn = NULL;/* Current root target */
    int           errors;   /* Number of targets not remade due to errors */

    Compat_Init();

    if (signal(SIGINT, SIG_IGN) != SIG_IGN) {
        signal(SIGINT, CompatInterrupt);
    }
    ...
}

    That, folks, is an example of poor coding.  SIGINT is disabled for 
    a few microseconds while the code checks to see if it is being ignored
    or not.

    Instead, sigaction() should be used to poll the current state of the
    signal to determine whether it is being ignored or not.

					-Matt
					Matthew Dillon 
					<dillon@xxxxxxxxxxxxx>



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]