public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/11839] gdb does not detect calls to dlmopen
[not found] <bug-11839-4717@http.sourceware.org/bugzilla/>
@ 2011-05-17 13:18 ` gbenson at redhat dot com
2011-06-07 15:21 ` gbenson at redhat dot com
` (8 subsequent siblings)
9 siblings, 0 replies; 10+ messages in thread
From: gbenson at redhat dot com @ 2011-05-17 13:18 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=11839
Gary Benson <gbenson at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |gbenson at redhat dot com
--- Comment #1 from Gary Benson <gbenson at redhat dot com> 2011-05-17 13:18:21 UTC ---
Confirmed (building on the testcase of bug 2328):
$ cat my_lib.c
#include <stdio.h>
int
sub1(int x)
{
printf("sub1 %d\n", x);
}
$ cat my_main_dlmopen.c
#define _GNU_SOURCE
#include <dlfcn.h>
int
main()
{
void *handle = dlmopen(LM_ID_NEWLM, "./my_lib.so", RTLD_LAZY);
void (*sub1)(int) = (void (*)(int))dlsym(handle, "sub1");
sub1(6);
return 0;
}
$ gcc -o my_lib.so -shared -fPIC -g my_lib.c
$ gcc -o my_main_dlmopen -g my_main_dlmopen.c -ldl
$ gdb my_main_dlmopen
GNU gdb (GDB) Fedora (7.2-51.fc14)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/gary/work/archer/my_main_dlmopen...done.
(gdb) set stop-on-solib-events 1
(gdb) r
Starting program: /home/gary/work/archer/my_main_dlmopen
Stopped due to shared library event
(gdb) info sh
>From To Syms Read Shared Object Library
0x0000003eac600b20 0x0000003eac618c46 Yes /lib64/ld-linux-x86-64.so.2
(gdb) c
Continuing.
Stopped due to shared library event
(gdb) info sh
>From To Syms Read Shared Object Library
0x0000003eac600b20 0x0000003eac618c46 Yes /lib64/ld-linux-x86-64.so.2
0x0000003ead600de0 0x0000003ead601988 Yes /lib64/libdl.so.2
0x0000003eace1eba0 0x0000003eacf45f5c Yes /lib64/libc.so.6
(gdb) c
Continuing.
Stopped due to shared library event
(gdb) info sh
>From To Syms Read Shared Object Library
0x0000003eac600b20 0x0000003eac618c46 Yes /lib64/ld-linux-x86-64.so.2
0x0000003ead600de0 0x0000003ead601988 Yes /lib64/libdl.so.2
0x0000003eace1eba0 0x0000003eacf45f5c Yes /lib64/libc.so.6
(gdb) c
Continuing.
Stopped due to shared library event
(gdb) info sh
>From To Syms Read Shared Object Library
0x0000003eac600b20 0x0000003eac618c46 Yes /lib64/ld-linux-x86-64.so.2
0x0000003ead600de0 0x0000003ead601988 Yes /lib64/libdl.so.2
0x0000003eace1eba0 0x0000003eacf45f5c Yes /lib64/libc.so.6
(gdb) c
Continuing.
sub1 6
Program exited normally.
--
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] 10+ messages in thread
* [Bug gdb/11839] gdb does not detect calls to dlmopen
[not found] <bug-11839-4717@http.sourceware.org/bugzilla/>
2011-05-17 13:18 ` [Bug gdb/11839] gdb does not detect calls to dlmopen gbenson at redhat dot com
@ 2011-06-07 15:21 ` gbenson at redhat dot com
2011-07-31 19:14 ` ppluzhnikov at google dot com
` (7 subsequent siblings)
9 siblings, 0 replies; 10+ messages in thread
From: gbenson at redhat dot com @ 2011-06-07 15:21 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=11839
--- Comment #2 from Gary Benson <gbenson at redhat dot com> 2011-06-07 15:20:52 UTC ---
I have been working on an improved linker-debugger interface to address this
and other issues. Please see these two threads for details:
http://sourceware.org/ml/archer/2011-q2/msg00000.html
http://sourceware.org/ml/archer/2011-q2/msg00015.html
I have not written any specific dlmopen-tracking code on the gdb side, but the
proposed new interface exposes the information you would require to do this via
SystemTap probes.
--
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] 10+ messages in thread
* [Bug gdb/11839] gdb does not detect calls to dlmopen
[not found] <bug-11839-4717@http.sourceware.org/bugzilla/>
2011-05-17 13:18 ` [Bug gdb/11839] gdb does not detect calls to dlmopen gbenson at redhat dot com
2011-06-07 15:21 ` gbenson at redhat dot com
@ 2011-07-31 19:14 ` ppluzhnikov at google dot com
2013-03-15 4:19 ` carlos at redhat dot com
` (6 subsequent siblings)
9 siblings, 0 replies; 10+ messages in thread
From: ppluzhnikov at google dot com @ 2011-07-31 19:14 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=11839
Paul Pluzhnikov <ppluzhnikov at google dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ppluzhnikov at google dot
| |com
--
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] 10+ messages in thread
* [Bug gdb/11839] gdb does not detect calls to dlmopen
[not found] <bug-11839-4717@http.sourceware.org/bugzilla/>
` (2 preceding siblings ...)
2011-07-31 19:14 ` ppluzhnikov at google dot com
@ 2013-03-15 4:19 ` carlos at redhat dot com
2013-03-15 10:09 ` palves at redhat dot com
` (5 subsequent siblings)
9 siblings, 0 replies; 10+ messages in thread
From: carlos at redhat dot com @ 2013-03-15 4:19 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=11839
Carlos O'Donell <carlos at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |carlos at redhat dot com
--- Comment #3 from Carlos O'Donell <carlos at redhat dot com> 2013-03-15 04:19:15 UTC ---
Just ran into this very issue while debugging BZ#15271.
I look forward to having this fixed one day.
--
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] 10+ messages in thread
* [Bug gdb/11839] gdb does not detect calls to dlmopen
[not found] <bug-11839-4717@http.sourceware.org/bugzilla/>
` (3 preceding siblings ...)
2013-03-15 4:19 ` carlos at redhat dot com
@ 2013-03-15 10:09 ` palves at redhat dot com
2013-09-19 15:02 ` gbenson at redhat dot com
` (4 subsequent siblings)
9 siblings, 0 replies; 10+ messages in thread
From: palves at redhat dot com @ 2013-03-15 10:09 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=11839
Pedro Alves <palves at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |palves at redhat dot com
--- Comment #4 from Pedro Alves <palves at redhat dot com> 2013-03-15 10:09:53 UTC ---
Lots of discussion happened on the libc-alpha (glibc) mailing list, around
2012-Dec - 2013-Jan.
The archives are silly and don't cross through month boundaries; for the whole
discussion start here:
http://sourceware.org/ml/libc-alpha/2012-12/
http://sourceware.org/ml/libc-alpha/2013-01/
and look for messages with subject "dlmopen and core dumps".
Started around here:
http://sourceware.org/ml/libc-alpha/2012-12/msg00268.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] 10+ messages in thread
* [Bug gdb/11839] gdb does not detect calls to dlmopen
[not found] <bug-11839-4717@http.sourceware.org/bugzilla/>
` (4 preceding siblings ...)
2013-03-15 10:09 ` palves at redhat dot com
@ 2013-09-19 15:02 ` gbenson at redhat dot com
2015-02-12 18:27 ` stsp at users dot sourceforge.net
` (3 subsequent siblings)
9 siblings, 0 replies; 10+ messages in thread
From: gbenson at redhat dot com @ 2013-09-19 15:02 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=11839
Gary Benson <gbenson at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
Last reconfirmed| |2013-09-19
Ever confirmed|0 |1
--- Comment #5 from Gary Benson <gbenson at redhat dot com> ---
I have filed bug 15971 to track the glibc side of this. Please add yourselves
to that bug's Cc list if you require.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug gdb/11839] gdb does not detect calls to dlmopen
[not found] <bug-11839-4717@http.sourceware.org/bugzilla/>
` (5 preceding siblings ...)
2013-09-19 15:02 ` gbenson at redhat dot com
@ 2015-02-12 18:27 ` stsp at users dot sourceforge.net
2021-11-20 15:53 ` ppluzhnikov at google dot com
` (2 subsequent siblings)
9 siblings, 0 replies; 10+ messages in thread
From: stsp at users dot sourceforge.net @ 2015-02-12 18:27 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=11839
Stas Sergeev <stsp at users dot sourceforge.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |stsp at users dot sourceforge.net
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug gdb/11839] gdb does not detect calls to dlmopen
[not found] <bug-11839-4717@http.sourceware.org/bugzilla/>
` (6 preceding siblings ...)
2015-02-12 18:27 ` stsp at users dot sourceforge.net
@ 2021-11-20 15:53 ` ppluzhnikov at google dot com
2022-10-18 13:24 ` cvs-commit at gcc dot gnu.org
2022-10-24 2:53 ` tromey at sourceware dot org
9 siblings, 0 replies; 10+ messages in thread
From: ppluzhnikov at google dot com @ 2021-11-20 15:53 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=11839
Paul Pluzhnikov <ppluzhnikov at google dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
--- Comment #6 from Paul Pluzhnikov <ppluzhnikov at google dot com> ---
I just spent a few hours debugging dlmopen issue, and having to manually add
the missing symbols on rerun gets annoying pretty fast.
The GLIBC bug 15971 has been fixed for GLIBC-2.35, now the ball is in GDB's
court.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug gdb/11839] gdb does not detect calls to dlmopen
[not found] <bug-11839-4717@http.sourceware.org/bugzilla/>
` (7 preceding siblings ...)
2021-11-20 15:53 ` ppluzhnikov at google dot com
@ 2022-10-18 13:24 ` cvs-commit at gcc dot gnu.org
2022-10-24 2:53 ` tromey at sourceware dot org
9 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-10-18 13:24 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=11839
--- Comment #7 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Markus Metzger <mmetzger@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8d56636a0ecbe6c38bf52b0683326ee21693c548
commit 8d56636a0ecbe6c38bf52b0683326ee21693c548
Author: Markus Metzger <markus.t.metzger@intel.com>
Date: Mon Oct 4 10:24:35 2021 +0200
gdb, gdbserver: support dlmopen()
In glibc, the r_debug structure contains (amongst others) the following
fields:
int r_version:
Version number for this protocol. It should be greater than 0.
If r_version is 2, struct r_debug is extended to struct r_debug_extended
with one additional field:
struct r_debug_extended *r_next;
Link to the next r_debug_extended structure. Each r_debug_extended
structure represents a different namespace. The first r_debug_extended
structure is for the default namespace.
1. Change solib_svr4_r_map argument to take the debug base.
2. Add solib_svr4_r_next to find the link map in the next namespace from
the r_next field.
3. Update svr4_current_sos_direct to get the link map in the next namespace
from the r_next field.
4. Don't check shared libraries in other namespaces when updating shared
libraries in a new namespace.
5. Update svr4_same to check the load offset in addition to the name
6. Update svr4_default_sos to also set l_addr_inferior
7. Change the flat solib_list into a per-namespace list using the
namespace's r_debug address to identify the namespace.
Add gdb.base/dlmopen.exp to test this.
To remain backwards compatible with older gdbserver, we reserve the
namespace zero for a flat list of solibs from all namespaces. Subsequent
patches will extend RSP to allow listing libraries grouped by namespace.
This fixes PR 11839.
Co-authored-by: Lu, Hongjiu <hongjiu.lu@intel.com>
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug gdb/11839] gdb does not detect calls to dlmopen
[not found] <bug-11839-4717@http.sourceware.org/bugzilla/>
` (8 preceding siblings ...)
2022-10-18 13:24 ` cvs-commit at gcc dot gnu.org
@ 2022-10-24 2:53 ` tromey at sourceware dot org
9 siblings, 0 replies; 10+ messages in thread
From: tromey at sourceware dot org @ 2022-10-24 2:53 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=11839
Tom Tromey <tromey at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at sourceware dot org
Resolution|--- |FIXED
Status|NEW |RESOLVED
Target Milestone|7.1 |13.1
--- Comment #8 from Tom Tromey <tromey at sourceware dot org> ---
Fix landed.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2022-10-24 2:53 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-11839-4717@http.sourceware.org/bugzilla/>
2011-05-17 13:18 ` [Bug gdb/11839] gdb does not detect calls to dlmopen gbenson at redhat dot com
2011-06-07 15:21 ` gbenson at redhat dot com
2011-07-31 19:14 ` ppluzhnikov at google dot com
2013-03-15 4:19 ` carlos at redhat dot com
2013-03-15 10:09 ` palves at redhat dot com
2013-09-19 15:02 ` gbenson at redhat dot com
2015-02-12 18:27 ` stsp at users dot sourceforge.net
2021-11-20 15:53 ` ppluzhnikov at google dot com
2022-10-18 13:24 ` cvs-commit at gcc dot gnu.org
2022-10-24 2:53 ` tromey at sourceware dot org
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).