Page MenuHomeFreeBSD

kerneldump: Inline dump_savectx() into its callers
ClosedPublic

Authored by markj on Mar 18 2023, 5:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 23 2025, 12:55 AM
Unknown Object (File)
Nov 13 2025, 1:09 AM
Unknown Object (File)
Nov 11 2025, 12:59 AM
Unknown Object (File)
Nov 4 2025, 3:51 AM
Unknown Object (File)
Oct 29 2025, 12:26 PM
Unknown Object (File)
Oct 29 2025, 11:24 AM
Unknown Object (File)
Oct 29 2025, 11:10 AM
Unknown Object (File)
Oct 29 2025, 11:05 AM
Subscribers

Details

Summary

The callers of dump_savectx() (i.e., doadump() and livedump_start())
subsequently call dumpsys()/minidumpsys(), which dump the calling
thread's stack when writing the dump. If dump_savectx() gets its own
stack frame, that frame might be clobbered when its caller later calls
dumpsys()/minidumpsys(), making it difficult for debuggers to unwind the
stack.

Fix this by making dump_savectx() a macro, so that savectx() is always
called directly by the function which subsequently calls
dumpsys()/minidumpsys().

This fixes stack unwinding for the panicking thread from arm64
minidumps. The same happened to work on amd64, but kgdb reports the
dump_savectx() calls as coming from dumpsys(), so in that case it
appears to work by accident.

Fixes: c9114f9f86f9 ("Add new vnode dumper to support live minidumps")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 50457
Build 47348: arc lint + arc unit