Debug symbols for VM kernel

I tried to get debug symbols to investigate a core dump of a recent VM kernel problem, but have had some trouble. For one thing, there don’t appear to be any debuginfo RPMs available for kernel packages. I set up qubes-builder to do this manually, but after setting “with_debuginfo” in (note that I don’t have prior experience with building RPMs so let me know if I’m doing this wrong), it fails due to missing the “pahole” dependency, and after adding “BuildRequires: dwarves”, it fails due to the version in fedora 25 being too old for kernel v5.10.13-1. Is there a better way of getting/building kernel debugging symbols?

Hi @dougm ,
welcome to this forum.

Will the kernel-*-devel-*.rpm packages help you? See the available packages.

I looked, these devel packages contain mainly the headers. The wanted packages are kernel-debuginfo-*.rpm which I can’t find…

Hi, @ludovic
As you say, it’s the -debuginfo packages that should have what I’m looking for. This line seems to indicate this should be build-able, I just can’t figure out how to do it.

Hi @adw, @unman and @deeplow ,

do you know how to answer to @dougm ? How to get or how to build the kernel-debuginfo-*.rpm packages?

Thanks for your help.

I’m afraid I don’t know, sorry.

same here

dwarves-1.16 or higher needs to be installed in the dom0 chroot and then it should work.

Fedora 25 only had v1.10, so you’ll have to find another way to get the right version in.

Option 1: download the source tarball, put it into the dom0 chroot, configure/make[/install], assuming dependencies are installed, like cmake.

Option 2: download source rpm from Fedora 32, massage the spec file to work on fc25, rpmbuild, install generated rpms

Option 3: Option 2, but after massaging the spec file, put it in qubes-src/dwarves with Makefile.builder/spec file/source, add to builder.conf COMPONENTS, add a BuildRequires in the kernel.spec for dwarves >= 1.16. This way, qubes-builder will build dwarves from qubes-src as an rpm, and once linux-kernel is built qubes-builder will find dwarves 1.16+ from the local repo of built packages.

Here’s some massaging I had to do to the dwarves-1.20 spec file from fc32:

< %cmake_build
> %make_build
< %cmake_install
> %make_install
< %ldconfig_scriptlets -n %{libname}%{libver}
> %post -p /sbin/ldconfig
> %postun -p /sbin/ldconfig

Unfortunately I ran out of disk space (and time) when it got to the modules.img steps, but it did generate the kernel & module BTF info. My dom0 chroot is sitting at 35GB just to build linux-kernel with debuginfo, so you’d probably want at least 50GB.

So in theory set with_debuginfo to 1 in kernel.spec and install dwarves 1.16+ in the dom0 chroot, and it should work…as long as you have the disk space…and patience.