public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/4131] New: BUG : dladdr() doesn't return the correct results
@ 2007-03-05 20:28 suzuki at in dot ibm dot com
  2007-03-05 20:29 ` [Bug libc/4131] " suzuki at in dot ibm dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: suzuki at in dot ibm dot com @ 2007-03-05 20:28 UTC (permalink / raw)
  To: glibc-bugs

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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-10-15  1:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-05 20:28 [Bug libc/4131] New: BUG : dladdr() doesn't return the correct results suzuki at in dot ibm dot com
2007-03-05 20:29 ` [Bug libc/4131] " suzuki at in dot ibm dot com
2007-05-06 21:02 ` drepper at redhat dot com
2007-07-12 15:15 ` cvs-commit at gcc dot gnu dot org
2007-10-09  5:06 ` bugs at elyoung dot com
2007-10-15  1:36 ` drepper at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).