Bug 183535

Summary: "panic: mutex CAM device lock not owned" booting FreeBSD-current (r257451) under Hyper-V
Product: Base System Reporter: xenophon+freebsd
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: CURRENT   
Hardware: Any   
OS: Any   

Description xenophon+freebsd 2013-10-31 19:20:00 UTC
FreeBSD panics at boot time when it begins attaching the Hyper-V synthetic storage driver:

 storvsc0 on vmbus0
 panic: mutex CAM device lock not owned at /usr/src/sys/cam/cam_periph.c:1042
 cpuid = 0
 KDB: stack backtrace:
 db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00f7f7b6b0
 kdb_backtrace() at kdb_backtrace+0x39/frame 0xfffffe00f7f7b760
 vpanic() at vpanic+0x126/frame 0xfffffe00f7f7b7a0
 panic() at panic+0x43/frame 0xfffffe00f7f7b800
 __mtx_assert() at __mtx_assert+0xc2/frame 0xfffffe00f7f7b810
 cam_periph_runccb() at cam_periph_runccb+0x49/frame 0xfffffe00f7f7b940
 storvsc_attach() at storvsc_attach+0x6d0/frame 0xfffffe00f7f7b9e0
 device_attach() at device_attach+0x3a2/frame 0xfffffe00f7f7ba40
 hv_vmbus_child_device_register() at hv_vmbus_child_device_register+0xba/frame 0xfffffe00f7f7bae0
 vmbus_channel_process_offer() at vmbus_channel_process_offer+0xec/frame 0xfffffe00f7f7bb10
 work_item_callback() at work_item_callback+0x2e/frame 0xfffffe00f7f7bb30
 taskqueue_run_locked() at taskqueue_run_locked+0xf0/frame 0xfffffe00f7f7bb80
 taskqueue_thread_loop() at taskqueue_thread_loop+0x9b/frame 0xfffffe00f7f7bbb0
 fork_exit() at fork_exit+0x84/frame 0xfffffe00f7f7bbf0
 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00f7f7bbf0
 --- trap 0, rip = 0, rsp = 0xfffffe00f7f7bcb0, rbp = 0 ---
 KDB: enter: panic
 [ thread pid 0 tid 100038 ]
 Stopped at      kdb_enter+0x3e: movq    $0,kdb_why

Switching to the ATA driver (hw.ata.disk_enable) results in the same panic:

 storvsc0 on vmbus0
 panic: mutex CAM device lock not owned at /usr/src/sys/cam/cam_periph.c:1042
 cpuid = 0
 KDB: stack backtrace:
 db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00f7fe06b0
 kdb_backtrace() at kdb_backtrace+0x39/frame 0xfffffe00f7fe0760
 vpanic() at vpanic+0x126/frame 0xfffffe00f7fe07a0
 panic() at panic+0x43/frame 0xfffffe00f7fe0800
 __mtx_assert() at __mtx_assert+0xc2/frame 0xfffffe00f7fe0810
 cam_periph_runccb() at cam_periph_runccb+0x49/frame 0xfffffe00f7fe0940
 storvsc_attach() at storvsc_attach+0x6d0/frame 0xfffffe00f7fe09e0
 device_attach() at device_attach+0x3a2/frame 0xfffffe00f7fe0a40
 hv_vmbus_child_device_register() at hv_vmbus_child_device_register+0xba/frame 0xfffffe00f7fe0ae0
 vmbus_channel_process_offer() at vmbus_channel_process_offer+0xec/frame 0xfffffe00f7fe0b10
 work_item_callback() at work_item_callback+0x2e/frame 0xfffffe00f7fe0b30
 taskqueue_run_locked() at taskqueue_run_locked+0xf0/frame 0xfffffe00f7fe0b80
 taskqueue_thread_loop() at taskqueue_thread_loop+0x9b/frame 0xfffffe00f7fe0bb0
 fork_exit() at fork_exit+0x84/frame 0xfffffe00f7fe0bf0
 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00f7fe0bf0
 --- trap 0, rip = 0, rsp = 0xfffffe00f7fe0cb0, rbp = 0 ---
 KDB: enter: panic
 [ thread pid 0 tid 100050 ]
 Stopped at      kdb_enter+0x3e: movq    $0,kdb_why

How-To-Repeat: See above.
Comment 1 Alexander Motin freebsd_committer freebsd_triage 2014-06-01 08:03:17 UTC
State Changed
From-To: open->closed

Fix committed to FreeBSD head at r262789.