#5229 closed bug (fixed)
PANIC: acquire_spinlock(): Failed to acquire spinlock 0xcdc5eb68 for a long time!
Reported by: | anevilyak | Owned by: | bonefish |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | System/Kernel | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Ran into this again while doing a full build inside the scheduling_recorder:
Welcome to Kernel Debugging Land... Thread 31237 "cc1" running on CPU 1 kdebug> bt stack trace for thread 31237 "cc1" kernel stack: 0xdeb40000 to 0xdeb44000 user stack: 0x7efed000 to 0x7ffed000 frame caller <image>:function + offset 0 deb43a30 (+ 32) 8006f8c1 <kernel_x86> invoke_command_trampoline(void*: 0xdeb43ab0) + 0x0015 1 deb43a50 (+ 12) 800df998 <kernel_x86>:arch_debug_call_with_fault_handler + 0x001b 2 deb43a5c (+ 48) 8006d7a2 <kernel_x86>:debug_call_with_fault_handler + 0x0051 3 deb43a8c (+ 64) 8006fc6a <kernel_x86>:invoke_debugger_command + 0x00bb 4 deb43acc (+ 48) 8006fd87 <kernel_x86> invoke_pipe_segment(debugger_command_pipe*: 0x80135622, int32: 0, char*: NULL) + 0x0083 5 deb43afc (+ 32) 8006fe4f <kernel_x86>:invoke_debugger_command_pipe + 0x008b 6 deb43b1c (+ 128) 80073bee <kernel_x86> ExpressionParser<0xdeb43bec>::_ParseCommandPipe(int&: 0xdeb43be8) + 0x0aae 7 deb43b9c (+ 48) 800763b7 <kernel_x86> ExpressionParser<0xdeb43bec>::EvaluateCommand(char const*: 0x80135620 "bt", int&: 0xdeb43be8) + 0x06df 8 deb43bcc (+ 192) 80076530 <kernel_x86>:evaluate_debug_command + 0x0084 9 deb43c8c (+ 96) 8006e6f2 <kernel_x86> kernel_debugger_internal(char const*: 0x1 "<???>", int32: -558613224) + 0x03a7 10 deb43cec (+ 16) 8006e853 <kernel_x86>:kernel_debugger + 0x0019 11 deb43cfc (+ 160) 8006e92d <kernel_x86>:panic + 0x002a 12 deb43d9c (+ 48) 8005a8bd <kernel_x86>:acquire_spinlock + 0x0052 13 deb43dcc (+ 48) 80078ae7 <kernel_x86> SystemProfiler<0xcdc5eb40>::ThreadEnqueuedInRunQueue(thread*: 0xcd31b000) + 0x002d 14 deb43dfc (+ 48) 80068f07 <kernel_x86> affine_enqueue_in_run_queue(thread*: 0xcd31b000) + 0x011f 15 deb43e2c (+ 48) 80043feb <kernel_x86> ConditionVariable<0xccd364c4>::_NotifyLocked(true, int32: 0) + 0x00bf 16 deb43e5c (+ 64) 80044089 <kernel_x86> ConditionVariable<0xccd364c4>::_Notify(true, false, int32: 0) + 0x0083 17 deb43e9c (+ 48) 807dd270 <ata> ATAChannel<0xccd364b0>::Interrupt(uint8: 0x50 (80)) + 0x0056 18 deb43ecc (+ 32) 807e0557 <ata> ata_interrupt_handler(void*: 0xccd364b0, uint8: 0x50 (80)) + 0x0024 19 deb43eec (+ 80) 807eca4c <ata_adapter>:ata_adapter_inthand + 0x00c0 20 deb43f3c (+ 48) 8004b774 <kernel_x86>:int_io_interrupt_handler + 0x0052 21 deb43f6c (+ 48) 800dc20f <kernel_x86> hardware_interrupt(iframe*: 0xdeb43fa8) + 0x0076 22 deb43f9c (+ 12) 800dfda6 <kernel_x86>:int_bottom_user + 0x005a user iframe at 0xdeb43fa8 (end = 0xdeb44000) eax 0x0 ebx 0x8b0678 ecx 0x6fff0000 edx 0x4 esi 0x1802db40 edi 0x0 ebp 0x0 esp 0xdeb43fdc eip 0x500846 eflags 0x10206 user esp 0x7ffecd00 vector: 0x2b, error code: 0x0 23 deb43fa8 (+558612568) 00500846 <cc1>:discard_stmt_changes + 0x0066 kdebug> spinlock 0xcdc5eb68 spinlock 0xcdc5eb68: locked from 0x80079a10
kdebug> calling 0x80079a10 yields no result though. Any ideas how to resolve where it was locked from? symbols 0x80079a10 does not appear to be helpful. Leaving in KDL pending further input.
Change History (6)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Also on CPU 0 the spinlock being acquired is 0x8013b678, locked from 0x8004404e.
follow-up: 4 comment:3 by , 15 years ago
In any case, I only ever see this problem with the scheduling_recorder, and the backtraces consistently point to the guts of the profiler so I'd unfortunately have to say this appears unrelated to your and Matt's problems, and instead is just a simple lock order reversal or similar issue in the kernel profiler :/
follow-up: 6 comment:4 by , 15 years ago
Status: | new → in-progress |
---|
Replying to anevilyak:
In any case, I only ever see this problem with the scheduling_recorder, and the backtraces consistently point to the guts of the profiler so I'd unfortunately have to say this appears unrelated to your and Matt's problems, and instead is just a simple lock order reversal or similar issue in the kernel profiler :/
Yep, that's indeed a locking order reversal. SystemProfiler::NextBuffer() uses a condition variable while holding the object's lock, and when waking up a waiting thread the condition variable code will enter the system profiler while holding the condition variable lock.
Regarding "calling" (and "bt"), ATM there's the somewhat annoying limitation on SMP machines that the stack trace code doesn't handle threads currently running on other CPUs specially. Which it should, though, since the current stack pointer in the thread's data is obsolete at this point. The command you're looking for is "ls" (lookup symbol), though. "help | grep symbol" FTW. :-)
comment:6 by , 15 years ago
Replying to bonefish:
Regarding "calling" (and "bt"), ATM there's the somewhat annoying limitation on SMP machines that the stack trace code doesn't handle threads currently running on other CPUs specially. Which it should, though, since the current stack pointer in the thread's data is obsolete at this point. The command you're looking for is "ls" (lookup symbol), though. "help | grep symbol" FTW. :-)
Thanks for the tip, I overlooked 'lookup' while browsing through the available commands, and wasn't aware the kernel debugger supported either pipes or grep, very cool :) And thanks for fixing that :)
If of interest, CPU 0's state was:
Running
calling 0x80079a10
yields a read fault here though.