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)
Nov 28 2024, 2:59 PM
Unknown Object (File)
Nov 18 2024, 9:38 AM
Unknown Object (File)
Nov 18 2024, 3:36 AM
Unknown Object (File)
Nov 12 2024, 8:13 PM
Unknown Object (File)
Nov 12 2024, 8:13 PM
Unknown Object (File)
Nov 12 2024, 3:22 PM
Unknown Object (File)
Nov 10 2024, 3:31 PM
Unknown Object (File)
Nov 8 2024, 1:38 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.