Re: panic: _mtx_lock_sleep: recursed on non-recursive mutex sbp _at_ /usr/src-8-mq/src/sys/cam/cam_periph.h:182

From: Paul B. Mahol <onemda_at_gmail.com>
Date: Wed, 17 Dec 2008 01:14:48 +0100
On 12/17/08, Artem Belevich <fbsdlist_at_src.cx> wrote:
> Freshly CVSupped -current/amd64 crashes on boot due to a locking issue
> in sys/cam.
>
> The crash may be related to this commit:
>
> http://svn.freebsd.org/viewvc/base?view=revision&revision=186186
> Author:	trasz
> Date:	Tue Dec 16 17:01:52 2008 UTC (6 hours, 37 minutes ago)
> Log Message:	Fix locking in periph drivers - don't try to unlock periph
> that was already deallocated.
>
> Reviewed by:	scottl
> Approved by:	rwatson (mentor)
> Sponsored by:	FreeBSD Foundation
>
> --Artem
>
> panic: _mtx_lock_sleep: recursed on non-recursive mutex sbp _at_
> /usr/src-8-mq/src/sys/cam/cam_periph.h:182
>
> cpuid = 0
> KDB: enter: panic
> [thread pid 12 tid 100026 ]
> Stopped at      kdb_enter+0x3d: movq    $0,0x487294(%rip)
> db> trace
> Tracing pid 12 tid 100026 td 0xffffff0004543720
> kdb_enter() at kdb_enter+0x3d
> panic() at panic+0x176
> _mtx_lock_flags() at _mtx_lock_flags
> _mtx_lock_flags() at _mtx_lock_flags+0xc3
> xpt_remove_periph() at xpt_remove_periph+0x25
> camperiphfree() at camperiphfree+0xbf
> cam_periph_release() at cam_periph_release+0x43
> probedone() at probedone+0x459
> camisr_runqueue() at camisr_runqueue+0x1b4
> camisr() at camisr+0xc0
> intr_event_execute_handlers() at intr_event_execute_handlers+0x68
> ithread_loop() at ithread_loop+0xae
> fork_exit() at fork_exit+0x12a
> fork_trampoline() at fork_trampoline+0xe
> --- trap 0, rip = 0, rsp = 0xfffffff8000a2d40, rbp = 0 ---
> db> show locks
> exclusive sleep mutex sbp (sbp) r = 0 (0xffffff00045a1ec8) locked _at_
> /usr/src-8-mq/src/sys/cam/cam_xpt.c:7137

+1
In my case, it panics with kldloading cam+atapicd+atapicam:

db:0:kdb.enter.panic>  run lockinfo
db:1:lockinfo> show locks
db:1:locks>  show alllocks
Process 627 (powerd) thread 0xc4131000 (100065)
Process 316 (devd) thread 0xc4001d80 (100053)
Process 2 (g_event) thread 0xc3cfd000 (100008)
Process 11 (intr) thread 0xc3fb16c0 (100076)
db:1:alllocks>  show lockedvnods
Locked vnodes
db:0:kdb.enter.panic>  show pcpu
cpuid        = 0
curthread    = 0xc3fb16c0: pid 11 "swi2: cambio"
curpcb       = 0xc3b32d90
fpcurthread  = none
idlethread   = 0xc3cfdb40: pid 10 "idle: cpu0"
APIC ID      = 0
currentldt   = 0x50
spin locks held:
db:0:kdb.enter.panic>  bt
Tracing pid 11 tid 100076 td 0xc3fb16c0
kdb_enter(c0620503,c0620503,c061ef92,c3b32798,0,...) at kdb_enter+0x3a
panic(c061ef92,c4406b3f,c436213d,b6,c3f92664,...) at panic+0x131
_mtx_lock_sleep(c3f92664,c3fb16c0,0,c436213d,b6,...) at _mtx_lock_sleep+0x4a
_mtx_lock_flags(c3f92664,0,c436213d,b6,c430b168,...) at _mtx_lock_flags+0xeb
xpt_remove_periph(c3fe9280,c436238d,0,c3b32888,c0604aca,...) at
xpt_remove_periph+0x31
camperiphfree(c3fe3020,c3b32bd8,c4347e55,c3fe9280,c3fe3020,...) at
camperiphfree+0xa2
cam_periph_release(c3fe9280,c3fe3020,c3fdec00,c3f4740c,c4348bc7,...)
at cam_periph_release+0x34
probedone(c3fe9280,c3fdec00,c4361fb8,c0625d7d,c3fc8b94,...) at probedone+0x4e0
camisr_runqueue(c3f92664,0,c4361fb8,1be1,0,...) at camisr_runqueue+0x16a
camisr(0,c3b32cc8,c04b0b0d,c06906c0,c3fc8b38,...) at camisr+0xcd
intr_event_execute_handlers(c3cfba90,c3fc8b00,c061c876,4dd,c3fc8b70,...)
at intr_event_execute_handlers+0x10f
ithread_loop(c3f3d5f0,c3b32d38,c061c5cc,32d,c3cfba90,...) at ithread_loop+0x98
fork_exit(c04a0cbf,c3f3d5f0,c3b32d38) at fork_exit+0xb8
fork_trampoline() at fork_trampoline+0x8
--- trap 0, eip = 0, esp = 0xc3b32d70, ebp = 0 ---


acd0: DVDR <TSSTcorpCD/DVDW TS-L632D/HH17> at ata1-master PIO4
acd0: FAILURE - INQUIRY ILLEGAL REQUEST asc=0x24 ascq=0x00
panic: _mtx_lock_sleep: recursed on non-recursive mutex ATAPICAM lock
_at_ _at_/cam/cam_periph.h:182

cpuid = 0
KDB: enter: panic
exclusive sleep mutex ATAPICAM lock (ATAPICAM lock) r = 0 (0xc3f92664)
locked _at_ /usr/src/sys/modules/ata/atapicam/../../../dev/ata/atapi-cam.c:642
exclusive sx cpufreq lock (cpufreq lock) r = 0 (0xc3e69c00) locked _at_
/usr/src/sys/kern/kern_cpu.c:252
exclusive sx sysctl lock (sysctl lock) r = 0 (0xc068c7e4) locked _at_
/usr/src/sys/kern/kern_sysctl.c:1417
exclusive sleep mutex Giant (Giant) r = 0 (0xc068c1b0) locked _at_
/usr/src/sys/kern/kern_sysctl.c:1355
shared sx filedesc structure (filedesc structure) r = 0 (0xc3faf32c)
locked _at_ /usr/src/sys/kern/sys_generic.c:958
exclusive sx GEOM topology (GEOM topology) r = 0 (0xc068a3c8) locked _at_
/usr/src/sys/geom/geom_event.c:185
exclusive sleep mutex ATAPICAM lock (ATAPICAM lock) r = 0 (0xc3f92664)
locked _at_ /usr/src/sys/modules/ata/atapicam/../../../dev/ata/atapi-cam.c:642


-- 
Paul
Received on Tue Dec 16 2008 - 23:14:50 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:39 UTC