Skip to content

how to determine which "vmlinux" to use when working with kernel dumps? #41

Open
@prakashsurya

Description

@prakashsurya

Currently, it's possible to debug a kernel crash dump with SDB by running something like this:

$ sdb /usr/lib/debug/boot/vmlinux-4.15.0-65-generic /var/crash/201910142024/dump.201910142024 -s /lib/modules/4.15.0-65-generic

The problem with this approach, though, is there's no guarantee that the crash dump (dump.201910142024) should be used with the "vmlinux" file (vmlinux-4.15.0-65-generic) passed to SDB.

For example, if multiple kernels are installed in /usr/lib/debug/boot (e.g. because multiple kernel packages are installed), how should the user determine which "vmlinux" to use when starting SDB? Additionally, what could happen if the wrong "vmlinux" file was specified? My guess is SDB my break in silent and subtle ways (i.e. it may show the wrong data, without outright failing).

I think we should improve the usability of SDB and harden it against incorrect usage, by not requiring the user to pass in the "vmlinux". For example, the dump contains some information about the kernel version that it needs:

$ sudo dd if=dump.201910142024 bs=1M count=1 2>/dev/null | strings | grep OSRELEASE
OSRELEASE=4.15.0-65-generic

Thus, we could modify SDB to look for this OSRELEASE information in the dump, and then automatically search the root filesystem for the "vmlinux" file that corresponds to that dump. Then, the interface for SDB could more simply be:

$ sdb /var/crash/201910142024/dump.201910142024

Which would prevent any possibility for the user to incorrectly pass in the wrong "vmlinux" file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions