panic on shutdown

Maxim Maximov mcsi at
Fri Sep 3 13:16:29 PDT 2004

John Baldwin wrote:
> On Friday 03 September 2004 01:21 pm, Maxim Maximov wrote:
>>Nate Lawson wrote:
>>>John Baldwin wrote:
>>>>On Thursday 02 September 2004 11:51 pm, Maxim Maximov wrote:
>>>>>    I just got this panic on shutdown using Power button, hand
>>>>>Syncing disks: <numbers>
>>>>>No buffers busy after final sync
>>>>>Uptime: 21m53s
>>>>>Powering system off using ACPI
>>>>>panic: lock (sleep mutex) Giant not locked @
>>>>>cpuid = 0
>>>>>KDB: enter: panic
>>>>>ACPI power-off failed - timeout
>>>>>cpu_reset: called on cpu#1
>>>>>cpu_reset: Stopping other CPUs
>>>>>Here it hung until I pressed Power button again. Then it shut down.
>>>>Looks like the timeout/callout routine dropped Giant more than it
>>>>acquired it.
>>>I don't see how this could be triggered by ACPI.  If you reboot the
>>>system with ACPI disabled (or enabled), do you also get this message?
>>My system can't boot with ACPI disabled.
>>Also I want to mention that this panic is rare. I've seen it about 10
>>times in 2-3 months of everyday rebooting.
>>And by the way, the command issued to shut the system down was 'halt -p'
> I would hack the timeout code to add some printf's before the 
> mtx_unlock(&Giant) to dump the function pointer and argument 
> if !tmtx_owned(&Giant) and then use gdb to figure out what the callout 
> function was.  I.e. something like:
> 	if (not mpsafe) {
> 		if (!mtx_owned(&Giant))
> 			printf("func = %p, arg = %p\n", c_func, c_arg)
> 		mtx_unlock(&Giant);
> 	}

Thanks, I recompiled kernel with this code. I'll let you know if this 
yields anything..

Maxim Maximov

More information about the freebsd-current mailing list