This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/4131] New: BUG : dladdr() doesn't return the correct results
- From: "suzuki at in dot ibm dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 5 Mar 2007 20:28:10 -0000
- Subject: [Bug libc/4131] New: BUG : dladdr() doesn't return the correct results
- Reply-to: sourceware-bugzilla at sourceware dot org
We encountered a problem with dl-addr which would return incorrect results for
an address lookup.
The problem occurs when a library (say libA) is mapped (by glibc) in the space
between two loaded segments of an already mapped library ( we have seen this
library is most of the time ld-linux.so). In this case we have,
LD.SO.l_map_start < LIBA.l_map_start < LIBA.l_map_end < LD.SO.l_map_end
So while looking up an address in LIBA, we get the result as LD.SO which
confuses the caller.
This is due to the following bug in the dl-addr logic:
1) We find a link_map whose [l_map_start,l_map_end) encloses the address.
2) We consult only the *LAST* loaded segment of the lib to check if the address
lies beyond the segment's end address.
So, if the ld.so is consulted before libA, we end up in returning ld.so as the
result.
The proper fix here would be to make sure that the address *falls in* _any_ of
the segments of the library.
--
Summary: BUG : dladdr() doesn't return the correct results
Product: glibc
Version: 2.4
Status: NEW
Severity: critical
Priority: P2
Component: libc
AssignedTo: drepper at redhat dot com
ReportedBy: suzuki at in dot ibm dot com
CC: glibc-bugs at sources dot redhat dot com
GCC build triplet: All
GCC host triplet: All
GCC target triplet: All
http://sourceware.org/bugzilla/show_bug.cgi?id=4131
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.