Subject: kern/14795: sched_lock panic
To: None <gnats-bugs@gnats.netbsd.org>
From: None <christos@zoulas.com>
List: netbsd-bugs
Date: 11/30/2001 12:44:34
>Number:         14795
>Category:       kern
>Synopsis:       sched_lock panic
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Nov 30 09:45:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Christos Zoulas
>Release:        20011128
>Organization:
	Bozon Manufacturing, LLC.
>Environment:
System: NetBSD dunno 1.5Z NetBSD 1.5Z (GENERIC.MP) #4: Thu Nov 29 17:21:49 EST 2001     christos@dunno:/home/NetBSD/cvsroot/src/sys/arch/i386/compile/GENERIC.MP i386
Architecture: i386
Machine: i386
>Description:
#20 0xc01db3f9 in panic ()
#21 0xc0471adb in __assert ()
#22 0xc01cf8bb in psignal1 (p=0xf9e828f4, signum=20, dolock=1)
    at /usr/src/sys/arch/i386/compile/GENERIC.MP/../../../../kern/kern_sig.c:740
#23 0xc01cfe85 in issignal (p=0xf9e82abc)
    at /usr/src/sys/arch/i386/compile/GENERIC.MP/../../../../kern/kern_sig.c:1104
#24 0xc01d1fa4 in ltsleep (ident=0xc0620904, priority=282, 
    wmesg=0xc049b6b7 "ttybg", timo=0, interlock=0x0)
    at /usr/src/sys/arch/i386/compile/GENERIC.MP/../../../../kern/kern_synch.c:452
#25 0xc01e5250 in ttysleep ()
#26 0xc01e2e29 in ttioctl ()
#27 0xc01e6794 in ptyioctl ()
#28 0xc02084d9 in spec_ioctl ()
#29 0xc01fd1b9 in VOP_IOCTL ()
#30 0xc01e79bb in cttyioctl ()
#31 0xc01fefef in fdesc_ioctl ()
#32 0xc01fd1b9 in VOP_IOCTL ()
#33 0xc01fcd15 in vn_ioctl ()
#34 0xc01de5c5 in sys_ioctl (p=0xf9e82abc, v=0xf9ebff80, retval=0xf9ebff78)
    at /usr/src/sys/arch/i386/compile/GENERIC.MP/../../../../kern/sys_generic.c:614
#35 0xc034690e in syscall_plain ()
#36 0xc010122c in syscall1 ()
(gdb) print sched_lock
$3 = {lock_data = 1, 
  lock_file = 0xc0498b60 "/usr/src/sys/arch/i386/compile/GENERIC.MP/../../../../kern/kern_synch.c", 
  unlock_file = 0xc04985e0 "/usr/src/sys/arch/i386/compile/GENERIC.MP/../../../../kern/kern_sig.c", lock_line = 403, unlock_line = 961, list = {
    tqe_next = 0x0, tqe_prev = 0xc05efc50}, lock_holder = 1}

lock_line 403 is really in kern_synch.c

Problem is that ltsleep calls CURSIG() after calling SCHED_LOCK(). This
inturn calls issignal() which can call psignal() kaboom.

>How-To-Repeat:
	run cvs update -d -A -P  & without setting your ssh key.
	The tty will try to prompt for passwd output and will
	cause the panic?
>Fix:
	dunno
>Release-Note:
>Audit-Trail:
>Unformatted: