Page MenuHomeFreeBSD

kern_shutdown: Always request a core dump in `vpanic()` even for a panic triggered while handling another one
Needs ReviewPublic

Authored by dumbbell on Oct 2 2023, 10:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 23, 4:53 AM
Unknown Object (File)
Apr 3 2024, 12:11 PM
Unknown Object (File)
Dec 26 2023, 10:10 AM
Unknown Object (File)
Dec 25 2023, 2:43 AM
Unknown Object (File)
Dec 21 2023, 5:34 AM
Unknown Object (File)
Dec 20 2023, 3:19 AM
Unknown Object (File)
Dec 10 2023, 11:50 PM
Unknown Object (File)
Nov 7 2023, 8:05 AM
Subscribers

Details

Reviewers
manu
Summary

Why

If some code crashes while a panic is handled, we didn't get a kernel core dump so far.

It is frustrating while working on the DRM drivers and their integration with vt(4) because it makes debugging more difficult. Indeed, a panic will usually display something on the console. If displaying something on the console triggered another panic in vt(4) or the DRM drivers before this patch, we wouldn't get any core dump.

How

The RB_DUMP flag is always set, not only for the top-level panic.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

I'm not familiar with this code path, will that means that we will try to dump always even if no dump devices are configured ?
I think that by default releases don't enable dump, will that cause any problems ?

In order to change this default, it must be demonstrated that a panic in disk driver dump code (e.g. sddadump()) will not trigger an endless panic recursion. I think the dumping variable protects from this, but it needs to be proven.

Alternatively, you could introduce a tunable (off by default), maybe debug.dump_on_recursive_panic, which would conditionally enable the behaviour you are seeking.