Bug 1253367 - find_debuginfo_in_path() can have difficulties locating split debug info files when build-id is not used
Summary: find_debuginfo_in_path() can have difficulties locating split debug info file...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: elfutils
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Mark Wielaard
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-13 14:38 UTC by Dodji Seketeli
Modified: 2015-08-17 13:40 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-17 13:40:47 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Dodji Seketeli 2015-08-13 14:38:56 UTC
This bug is extracted from a bug filed to libabigail at https://sourceware.org/bugzilla/show_bug.cgi?id=18792.

Basically when a library /prefix1/prefix2/libfoo.so has its split debug info at /prefix1/usr/lib/debug/prefix2/libfoo.so, and the debug_link property of the library contains "libfoo.so" which designates the name of the of the debug info file, and the Dwfl_Callbacks::debuginfo_path is correctly set to point to /prefix1/usr/lib/debug, dwfl_module_getdwarf() fails to locate the split debug info file.

Comment 1 Dodji Seketeli 2015-08-13 14:42:50 UTC
I have debugged this and it seems to me that find_debuginfo_in_path() is the one function that is having difficulties in locating the debug infor file libfoo.so under /usr/prefix1/usr/lib/debug.

I have cooked a patch candidate (which comes with no test case yet, alas) that fixes the issue for me, but I'd like your input as to what I might not be doing correctly.

The patch is attached to bug https://sourceware.org/bugzilla/show_bug.cgi?id=18792#c5 and can be viewed at https://sourceware.org/bugzilla/attachment.cgi?id=8517&action=diff.

Comment 2 Mark Wielaard 2015-08-13 22:01:18 UTC
:
A nicer URL to view the proposed patch plus explanation is:
https://sourceware.org/bugzilla/attachment.cgi?id=8517

I think I understand the proposed change and why it makes sense to try and strip prefix paths under the debuginfo_path during the search. But the following part in the explanation confuses me:

> The problem is, when find_debuginfo_in_path() is called with its
> file_name parameter set to "/prefix1/prefix2/libfoo.so" and
> mod->dwfl->callbacks->debuginfo_path set to
> "/prefix1/lib/debug/prefix2/libfoo.so", it fails to locate the debug
> info file libfoo.so under "/prefix1/lib/debug".

Should that have been:

  ... debuginfo_path set to "/prefix1/lib/debug/", it fails to locate
  the debug info file libfoo.so under "/prefix1/usr/lib/debug/prefix2/".

Comment 3 Dodji Seketeli 2015-08-14 08:42:16 UTC
(In reply to Mark Wielaard from comment #2)
> :
> A nicer URL to view the proposed patch plus explanation is:
> https://sourceware.org/bugzilla/attachment.cgi?id=8517
> 
> I think I understand the proposed change and why it makes sense to try and
> strip prefix paths under the debuginfo_path during the search. But the
> following part in the explanation confuses me:
> 
> > The problem is, when find_debuginfo_in_path() is called with its
> > file_name parameter set to "/prefix1/prefix2/libfoo.so" and
> > mod->dwfl->callbacks->debuginfo_path set to
> > "/prefix1/lib/debug/prefix2/libfoo.so", it fails to locate the debug
> > info file libfoo.so under "/prefix1/lib/debug".
> 
> Should that have been:
> 
>   ... debuginfo_path set to "/prefix1/lib/debug/", it fails to locate
>   the debug info file libfoo.so under "/prefix1/usr/lib/debug/prefix2/".

You are right, I messed up that part of the explanation! Sorry.

Comment 4 Mark Wielaard 2015-08-14 14:43:40 UTC
Posted a tweaked version of the patch and a testcase to the elfutils list:
https://lists.fedorahosted.org/pipermail/elfutils-devel/2015-August/005082.html

Comment 5 Dodji Seketeli 2015-08-17 13:40:47 UTC
This has been fixed by commit https://git.fedorahosted.org/cgit/elfutils.git/commit/?id=b901b5e742e03d781fe9b6ecf030d6d297948018.


Note You need to log in before you can comment on or make changes to this bug.