[Bug 1848211]

Mark J. Wielaard 1848211 at bugs.launchpad.net
Tue Mar 9 14:15:48 UTC 2021


It was a bit of a struggle to get this reproduced. Installing debuginfo
(dbgsym) packages is not the simplest thing. But once you finally manage
then you can indeed replicate it simply with: valgrind/vg-in-place -v
/usr/bin/gio ~

--3475-- Reading syms from /usr/bin/gio
--3475--   Considering /usr/lib/debug/.build-id/50/d6f5b1c2450bf79554ee66724c911a73f1f635.debug ..
--3475--   .. build-id is valid
--3475-- WARNING: Serious error when reading debug info
--3475-- When reading debug info from /usr/bin/gio:
--3475--    debuginfo section duplicates a section in the main ELF file

And indeed /usr/bin/gio has both a .gnu_debugaltlink and .gnu_debuglink
section.

The .gnu_debugaltlink points to /usr/lib/debug/.dwz/x86_64-linux-
gnu/libglib2.0-bin.debug

The .gnu_debuglink points to
"d6f5b1c2450bf79554ee66724c911a73f1f635.debug" (odd imho that is named
after part of the build-id), luckily we look it up through the build-id
and end up at /usr/lib/debug/.build-
id/50/d6f5b1c2450bf79554ee66724c911a73f1f635.debug (which turns out to
be a real file, not a symlink?)

That .debug file also has a .debug_gnualtlink section which points to
the same /usr/lib/debug/.dwz/x86_64-linux-gnu/libglib2.0-bin.debug
(side-note, given that this is an absolute path instead of a relative
path, this makes things even harder to resolve unless everything is
installed in the correct place, or you resolve everything through ids).

Since they are the same we can indeed just pick one. I believe this is a
really odd thing to do, but we shouldn't really crash and burn.

The proposed patch seems to be a simplest way to do that.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to valgrind in Ubuntu.
https://bugs.launchpad.net/bugs/1848211

Title:
  [SRU] valgrind fails to use debug symbols from glib/gtk

Status in Valgrind:
  Fix Released
Status in valgrind package in Ubuntu:
  Fix Released
Status in valgrind source package in Bionic:
  Triaged
Status in valgrind source package in Disco:
  Won't Fix
Status in valgrind source package in Eoan:
  Fix Released
Status in valgrind source package in Focal:
  Fix Released
Status in valgrind package in Debian:
  Fix Released

Bug description:
  [Impact]

   * With dwz the .gnu_debuglink section may appear duplicated in the
  debug file referenced originally in the .gnu_debuglink section. In
  that case Valgrind fails to load the debug symbols.

  [Test Case]

   * In Ubuntu releases earlier than 19.10 use gio from a package rebuilt with dwz.
   * Install debug symbols for gio following the guide at https://wiki.ubuntu.com/Debug%20Symbol%20Packages
   * Observe no relevant error when running gio with valgrind:
     $ valgrind /usr/bin/gio ~

  [Regression Potential]

   * The fix is very simple, just ignoring the second .gnu_debuglink
  found. There are no likely regressions.

  [Original Bug Text]

  The debug symbols from libglib2.0-0-dbgsym and libgtk-3-0-dbgsym don't
  get properly picked up by valgrind in eoan for some reason. The
  symbols correctly work under gdb.

  There is an warning printed from valgrind
  'debuginfo section duplicates a section in the main ELF file'

  Laney tried to rebuild without dh_dwz and it makes the warning go away and the symbol work.
  Downgrading valgrind to the disco version doesn't fix the issue.

To manage notifications about this bug go to:
https://bugs.launchpad.net/valgrind/+bug/1848211/+subscriptions



More information about the foundations-bugs mailing list