public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/11766] New: gdb does not resolve correctly symbols in binaries loaded twice with dlmopen
@ 2010-06-29 11:51 mathieu dot lacage at gmail dot com
  2010-06-29 11:52 ` [Bug symtab/11766] " mathieu dot lacage at gmail dot com
  2010-06-29 11:54 ` mathieu dot lacage at gmail dot com
  0 siblings, 2 replies; 4+ messages in thread
From: mathieu dot lacage at gmail dot com @ 2010-06-29 11:51 UTC (permalink / raw)
  To: gdb-prs

The crux of the problem is that gdb believes that two entries in the inferior
linkmap are the same if the associated filename is the same. If you use dlmopen
to load the same binary twice at different base addresses, the correct test for
equality is if the filenames are the same _and_ the base addresses are the same.

the attached tarball contains a minimal testcase to reproduce this bug and the
attached patch fixes this bug as suggested by tom tromey on the gdb mailing-list.

how to reproduce:
tar zxf test.tar.gz
cd test
gdb ./test
run b

output:
#0  0x00007ffff785c567 in ?? ()
#1  0x00007fffffffe0b0 in ?? ()
#2  0x0000000000400641 in call (h=0x7ffff785c557, 


expected output:
the symbol 'bar' should be resolved.

-- 
           Summary: gdb does not resolve correctly symbols in binaries
                    loaded twice with dlmopen
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: symtab
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: mathieu dot lacage at gmail dot com
                CC: gdb-prs at sourceware dot org
 GCC build triplet: x86_64-redhat-linux-gnu
  GCC host triplet: x86_64-redhat-linux-gnu
GCC target triplet: x86_64-redhat-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=11766

------- 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] 4+ messages in thread

* [Bug symtab/11766] gdb does not resolve correctly symbols in binaries loaded twice with dlmopen
  2010-06-29 11:51 [Bug symtab/11766] New: gdb does not resolve correctly symbols in binaries loaded twice with dlmopen mathieu dot lacage at gmail dot com
@ 2010-06-29 11:52 ` mathieu dot lacage at gmail dot com
  2010-06-29 11:54 ` mathieu dot lacage at gmail dot com
  1 sibling, 0 replies; 4+ messages in thread
From: mathieu dot lacage at gmail dot com @ 2010-06-29 11:52 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From mathieu dot lacage at gmail dot com  2010-06-29 11:52 -------
Created an attachment (id=4861)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=4861&action=view)
reduced testcase

this program shows that gdb can resolve correctly the symbols in the first
version of the binary loaded with dlmopen but not with the second version. (try
'run a' vs 'run b')

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11766

------- 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] 4+ messages in thread

* [Bug symtab/11766] gdb does not resolve correctly symbols in binaries loaded twice with dlmopen
  2010-06-29 11:51 [Bug symtab/11766] New: gdb does not resolve correctly symbols in binaries loaded twice with dlmopen mathieu dot lacage at gmail dot com
  2010-06-29 11:52 ` [Bug symtab/11766] " mathieu dot lacage at gmail dot com
@ 2010-06-29 11:54 ` mathieu dot lacage at gmail dot com
  1 sibling, 0 replies; 4+ messages in thread
From: mathieu dot lacage at gmail dot com @ 2010-06-29 11:54 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From mathieu dot lacage at gmail dot com  2010-06-29 11:54 -------
Created an attachment (id=4862)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=4862&action=view)
fix this bug

This patch makes sure that gdb creates one debuginfo entry exists per
inferior-loaded-library.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11766

------- 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] 4+ messages in thread

* [Bug symtab/11766] gdb does not resolve correctly symbols in binaries loaded twice with dlmopen
       [not found] <bug-11766-4717@http.sourceware.org/bugzilla/>
@ 2011-02-03  5:27 ` ppluzhnikov at google dot com
  0 siblings, 0 replies; 4+ messages in thread
From: ppluzhnikov at google dot com @ 2011-02-03  5:27 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=11766

Paul Pluzhnikov <ppluzhnikov at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |ppluzhnikov at google dot
                   |                            |com
         Resolution|                            |FIXED

--- Comment #3 from Paul Pluzhnikov <ppluzhnikov at google dot com> 2011-02-03 05:27:18 UTC ---
This patch has been committed:
http://sourceware.org/ml/gdb-patches/2011-01/msg00509.html

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

end of thread, other threads:[~2011-02-03  5:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-29 11:51 [Bug symtab/11766] New: gdb does not resolve correctly symbols in binaries loaded twice with dlmopen mathieu dot lacage at gmail dot com
2010-06-29 11:52 ` [Bug symtab/11766] " mathieu dot lacage at gmail dot com
2010-06-29 11:54 ` mathieu dot lacage at gmail dot com
     [not found] <bug-11766-4717@http.sourceware.org/bugzilla/>
2011-02-03  5:27 ` ppluzhnikov at google 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).