public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "suzuki at in dot ibm dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sources.redhat.com
Subject: [Bug libc/4131] New: BUG : dladdr() doesn't return the correct results
Date: Mon, 05 Mar 2007 20:28:00 -0000	[thread overview]
Message-ID: <20070305202809.4131.suzuki@in.ibm.com> (raw)

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.


             reply	other threads:[~2007-03-05 20:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-05 20:28 suzuki at in dot ibm dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070305202809.4131.suzuki@in.ibm.com \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).