19

When loading core dump files into gdb, I am getting the following warning, looks like loading some symbols also fails because of this.

warning: Cannot parse .gnu_debugdata section; LZMA support was disabled at compile time

Any idea how I can resolve this?

ks1322
  • 33,961
  • 14
  • 109
  • 164
PMat
  • 2,039
  • 2
  • 29
  • 46

1 Answers1

24

warning: Cannot parse .gnu_debugdata section; LZMA support was disabled at compile time

GDB supports a feature called "mini debug info". This feature allows adding a subset of full debugging info to a special section of the resulting file. Some Linux distros, like Fedora, use this to ship partial debuginfo so that stack traces can be more easily "symbolicated".

This section is compressed using LZMA, and so GDB must be built with LZMA support in order to read the section.

Your GDB was not built with this support, so it is informing you that it found a .gnu_debugdata section, but could not read it.

Normally this is of no concern. It may mean you see slightly worse stack traces for code from system libraries.

The fix is to rebuild GDB, making sure you have the LZMA development packages installed before running configure.

Tom Tromey
  • 21,507
  • 2
  • 45
  • 63
  • Thanks Tom, I was able to fix that. – PMat Apr 20 '17 at 21:08
  • 2
    Thanks! For anyone wanting to do this on ubuntu (and probably debian, also): `apt install lzma-dev`. If you have a build tree already, remove all config.cache files before rebuilding. – Chris Aug 30 '18 at 13:28
  • To ensure GDB is built with LZMA support add [`--with-lzma` to its `configure` invocation](https://sourceware.org/gdb/onlinedocs/gdb/Configure-Options.html). To install the necessary package for Fedora/CentOS/RockyLinux/RHEL `yum install xz-devel`. – Simon Sobisch Mar 09 '23 at 13:15