NetBSD-Bugs archive

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

kern/51328: ddb kill command causes a panic with LOCKDEBUG

>Number:         51328
>Category:       kern
>Synopsis:       ddb kill command causes a panic with LOCKDEBUG
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 09 09:20:00 +0000 2016
>Originator:     Ryota Ozaki
>Release:        NetBSD-current
NetBSD kvm 7.99.33 NetBSD 7.99.33 (KVM) #179: Thu Jul  7 18:21:44 JST 2016  ozaki-r@rangeley:(hidden) amd64
ddb's kill command causes a panic on a kernel with LOCKDEBUG enabled.

It seems to happen because db_kill_proc tries to acquire an adaptive mutex
(proc_lock) in hardware interrupt.

db{0}> kill 34                                                                                                            [274/1978]
Mutex error: lockdebug_wantlock: acquiring sleep lock from interrupt context

lock address : 0xfffffe803fe14f00 type     :     sleep/adaptive
initialized  : 0xffffffff80529b4a
shared holds :                  0 exclusive:                  0
shares wanted:                  0 exclusive:                  0
current cpu  :                  0 last held:                  2
current lwp  : 0xfffffe803fd0f440 last held: 000000000000000000
last locked  : 0xffffffff805442f3 unlocked*: 0xffffffff80544324
owner field  : 0xfffffe803fd0f440 wait/spin:                0/0

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

panic: LOCKDEBUG: Mutex error: lockdebug_wantlock: acquiring sleep lock from interrupt context
fatal breakpoint trap in supervisor mode
trap type 1 code 0 rip ffffffff80114bc5 cs 8 rflags 246 cr2 ffff80001324197a ilevel 8 rsp fffffe8002ca5790
curlwp 0xfffffe803fd0f440 pid 0.6 lowest kstack 0xfffffe8002ca22c0
Stopped in pid 0.6 (system) at  netbsd:breakpoint+0x5:  leave
db{0}> bt
breakpoint() at netbsd:breakpoint+0x5
vpanic() at netbsd:vpanic+0x140
snprintf() at netbsd:snprintf
lockdebug_more() at netbsd:lockdebug_more
mutex_tryenter() at netbsd:mutex_tryenter+0x172
db_kill_proc() at netbsd:db_kill_proc+0x53
db_command() at netbsd:db_command+0xeb
db_command_loop() at netbsd:db_command_loop+0x90
db_trap() at netbsd:db_trap+0xe3
kdb_trap() at netbsd:kdb_trap+0xe1
trap() at netbsd:trap+0x4f2
--- trap (number 1) ---
breakpoint() at netbsd:breakpoint+0x5
comintr() at netbsd:comintr+0x562
Xintr_ioapic_edge7() at netbsd:Xintr_ioapic_edge7+0xea
--- interrupt ---
Xspllower() at netbsd:Xspllower+0xe
ttstart() at netbsd:ttstart+0x12
softint_dispatch() at netbsd:softint_dispatch+0xd4
DDB lost frame for netbsd:Xsoftintr+0x4f, trying 0xfffffe8002ca5ff0
Xsoftintr() at netbsd:Xsoftintr+0x4f
--- interrupt ---

Enable LOCKDEBUG of your kernel and boot it.
Enter ddb and execute kill command.

Home | Main Index | Thread Index | Old Index