Subject: kern/37507: LOCKDEBUG panic during util/systrace/t_id test
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <dlagno@rambler.ru>
List: netbsd-bugs
Date: 12/09/2007 19:20:00
>Number:         37507
>Category:       kern
>Synopsis:       LOCKDEBUG panic during util/systrace/t_id test
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 09 19:20:00 +0000 2007
>Originator:     Denis Lagno
>Release:        4.99.40
>Organization:
>Environment:
NetBSD flam.gado 4.99.40 NetBSD 4.99.40 (FLAM) #0: Thu Dec  6 22:01:45 MSK 2007  dina@flam.gado:/volatile/worksrc/netbsd-current/obj/sys/arch/i386/compile/FLAM i386

2 CPUs
>Description:
During util/systrace/t_id test in atf-run there is reproducible LOCKDEBUG panic:

Mutex error: free: allocation contains active lock

lock address : 0x00000000c28f4680 type     :     sleep/adaptive
shared holds :                  0 exclusive:                  0
shares wanted:                  0 exclusive:                  0
current cpu  :                  1 last held:                  1
current lwp  : 0x00000000d05d6e00 last held: 000000000000000000
last locked  : 0x00000000c04d6f0c unlocked : 0x00000000c04d6fd0
initialized  : 0x00000000c04d6aab
owner field  : 000000000000000000 wait/spin:                0/0

Turnstile chain at 0xc0b27b00.
=> No active turnstile for this lock.

panic: LOCKDEBUG
Stopped in pid 15654.1 (h_have_systrace) at     netbsd:breakpoint+0x1:  ret
db{1}> bt
breakpoint(c09fd807,c09f9b7d,c08277c4,c09fda44,80) at netbsd:breakpoint+0x1
lockdebug_abort1(c09fda44,1,80,c28f4680,c28f4680) at netbsd:lockdebug_abort1+0x7
2
free(c28f4680,c0a79e00,0,0,cd13d628) at netbsd:free+0x167
systracef_close(cd13d628,d05d6e00,0,0,d05d6e00) at netbsd:systracef_close+0xfa
closef(cd13d628,d05d6e00,cd1e6c58,bb901000,bb901000) at netbsd:closef+0x14f
syscall(cd1e6c78,b3,ab,1f,1f) at netbsd:syscall+0x1c4

>How-To-Repeat:
cd /usr/tests; atf-run

on 2-way machine with options LOCKDEBUG and SySTRACE
>Fix: