NetBSD-Bugs archive

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

kern/40341: raise() is not thread-aware



>Number:         40341
>Category:       kern
>Synopsis:       raise() is not thread-aware
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 07 21:30:00 +0000 2009
>Originator:     Andrew Doran
>Release:        5.0_BETA
>Organization:
The NetBSD Project
>Environment:
n/a
>Description:
The OpenGroup web site says that raise() should direct the signal to the 
current thread if possible. This is important for some uses, e.g. abort(),
which need to kill the calling thread. Right now, the signal is not 
directed on NetBSD and so could be taken by another thread:

     44 int
     45 raise(s)
     46         int s;
     47 {
     48         return(kill(getpid(), s));
     49 }

>How-To-Repeat:
Code inspection.
>Fix:
Change the above to:

    return _lwp_kill(_lwp_self(), s);

It's a simple fix but I don't have time right now.



Home | Main Index | Thread Index | Old Index