NetBSD-Bugs archive

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

kern/38222: setrunnable: locking misuse /documentation issue.



>Number:         38222
>Category:       kern
>Synopsis:       setrunnable: locking misuse /documentation issue.
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 11 15:30:00 +0000 2008
>Originator:     Mindaugas Rasiukevicius <rmind at NetBSD org>
>Release:        NetBSD 4.99.55
>Organization:
>Environment:
>Description:
        setrunnable() function in kern_synch.c assumes that l->l_mutex can be
        l->l_cpu->ci_schedstate.spc_mutex. According to locking documentation,
        threads in LSSTOP, LSSUSPENDED or LSSLEEP cannot hold the lock. However,
        <ad> has noted, this is/may be wrong. References:

        http://nxr.netbsd.org/source/xref/sys/kern/kern_lwp.c#148
        
http://nxr.netbsd.org/source/diff/sys/kern/kern_synch.c?r2=1.206&r1=1.205

        Note, there were no reports, that following KASSERT has fired:

        http://nxr.netbsd.org/source/xref/sys/kern/kern_synch.c#640

        Thus, assumption in setrunnable() looks wrong for me.

>How-To-Repeat:
        Code inspection.
>Fix:
        Locking documentation or code must be fixed.



Home | Main Index | Thread Index | Old Index