NetBSD-Bugs archive

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

Re: kern/38085: l_priority not protected against sloppy developers.



The following reply was made to PR kern/38085; it has been noted by GNATS.

From: christos%zoulas.com@localhost (Christos Zoulas)
To: gnats-bugs%NetBSD.org@localhost, kern-bug-people%netbsd.org@localhost, 
        gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/38085: l_priority not protected against sloppy developers.
Date: Fri, 22 Feb 2008 17:13:54 -0500

 On Feb 22,  9:00pm, hpeyerl%NetBSD.org@localhost 
(hpeyerl%NetBSD.org@localhost) wrote:
 -- Subject: kern/38085: l_priority not protected against sloppy developers.
 
 | >Number:         38085
 | >Category:       kern
 | >Synopsis:       l_priority not protected against sloppy developers.
 | >Confidential:   no
 | >Severity:       non-critical
 | >Priority:       low
 | >Responsible:    kern-bug-people
 | >State:          open
 | >Class:          sw-bug
 | >Submitter-Id:   net
 | >Arrival-Date:   Fri Feb 22 21:00:00 +0000 2008
 | >Originator:     Herb Peyerl
 | >Release:        NetBSD-current
 | >Organization:
 | >Environment:
 | System: NetBSD andgasm.beer.org 3.1 NetBSD 3.1 (GENERIC.MP) #0: Tue Oct 31 
04:42:38 UTC 2006 
builds%b0.netbsd.org@localhost:/home/builds/ab/netbsd-3-1-RELEASE/i386/200610302053Z-obj/home/builds/ab/netbsd-3-1-RELEASE/src/sys/arch/i386/compile/GENERIC.MP
 i386
 | Architecture: i386
 | Machine: i386
 | >Description:
 | 
 |      A sloppy programmer (not me) who does:
 | 
 |     tsleep( arg, -1, "zzzzzz", 0 );
 | 
 | ...can inadvertantly trash the runqueue/sleepq's causing someone (me) to 
spend
 | lots of quality time with ddb...
 | 
 | >How-To-Repeat:
 | >Fix:
 |      Something like this?
 | 
 | Index: kern_sleepq.c
 | ===================================================================
 | RCS file: /cvsroot/src/sys/kern/kern_sleepq.c,v
 | retrieving revision 1.21
 | diff -r1.21 kern_sleepq.c
 | 456c456
 | <    l->l_priority = pri;
 | ---
 | >    l->l_priority = (pri & MAXPRI);
 | 472c472
 | <    l->l_inheritedprio = pri;
 | ---
 | >    l->l_inheritedprio = (pri & MAXPRI);
 
 I think sloppy programmers should be spanked, and this should be a KASSERT()
 instead.
 
 christos
 


Home | Main Index | Thread Index | Old Index