Bug 21602 - dwfl_addrmodule reports bogus modules for unmapped areas
Summary: dwfl_addrmodule reports bogus modules for unmapped areas
Status: NEW
Alias: None
Product: elfutils
Classification: Unclassified
Component: libdw (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-15 20:37 UTC by Jan Kratochvil
Modified: 2017-06-15 21:05 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
shown debugging output patch (460 bytes, patch)
2017-06-15 21:05 UTC, Jan Kratochvil
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kratochvil 2017-06-15 20:37:29 UTC
LD_LIBRARY_PATH=./libdw/ ./src/addr2line -p $p 0x7f7d33043000

Actual:
insert: 0x55be1a359000..0x55be1a561000 i=0 segndx=-1 need_start=1 need_end=1
insert: 0x7f7d2c0e7000..0x7f7d32c80000 i=2 segndx=-1 need_start=1 need_end=1
insert: 0x7f7d33046000..0x7f7d3326d000 i=4 segndx=-1 need_start=1 need_end=1
insert: 0x7ffdcf1bc000..0x7ffdcf1be000 i=6 segndx=-1 need_start=1 need_end=1
0x7f7d33043000 -> /usr/lib64/libc-2.24.so
??:0

Expected:
0x7f7d33043000 -> null
??:0

reify_segments() seems to do something wrong.  That lookup_addr array seems to be wrongly built.


55be1a359000-55be1a360000 r-xp 00000000 fd:00 13636393                   /usr/bin/sleep
55be1a55f000-55be1a560000 r--p 00006000 fd:00 13636393                   /usr/bin/sleep
55be1a560000-55be1a561000 rw-p 00007000 fd:00 13636393                   /usr/bin/sleep
55be1be9b000-55be1bebc000 rw-p 00000000 00:00 0                          [heap]
7f7d2c0e7000-7f7d32c80000 r--p 00000000 fd:00 13651402                   /usr/lib/locale/locale-archive
7f7d32c80000-7f7d32e3d000 r-xp 00000000 fd:00 13632051                   /usr/lib64/libc-2.24.so
7f7d32e3d000-7f7d3303c000 ---p 001bd000 fd:00 13632051                   /usr/lib64/libc-2.24.so
7f7d3303c000-7f7d33040000 r--p 001bc000 fd:00 13632051                   /usr/lib64/libc-2.24.so
7f7d33040000-7f7d33042000 rw-p 001c0000 fd:00 13632051                   /usr/lib64/libc-2.24.so
7f7d33042000-7f7d33046000 rw-p 00000000 00:00 0 
^^^ 0x7f7d33043000 belongs here with no mapped file
7f7d33046000-7f7d3306b000 r-xp 00000000 fd:00 13632665                   /usr/lib64/ld-2.24.so
7f7d3323d000-7f7d3323f000 rw-p 00000000 00:00 0 
7f7d33269000-7f7d3326b000 rw-p 00000000 00:00 0 
7f7d3326b000-7f7d3326c000 r--p 00025000 fd:00 13632665                   /usr/lib64/ld-2.24.so
7f7d3326c000-7f7d3326d000 rw-p 00026000 fd:00 13632665                   /usr/lib64/ld-2.24.so
Comment 1 Jan Kratochvil 2017-06-15 21:05:26 UTC
Created attachment 10149 [details]
shown debugging output patch