This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77772] Segmentation fault when running an application with gdb
- From: "antonio.poggiali at datalogic dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 28 Sep 2016 11:18:39 +0000
- Subject: [Bug c++/77772] Segmentation fault when running an application with gdb
- Auto-submitted: auto-generated
- References: <bug-77772-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77772
--- Comment #5 from Antonio Poggiali <antonio.poggiali at datalogic dot com> ---
(In reply to Richard Biener from comment #4)
> This looks like a libc/loader issue to me. My source points at
>
> /* Initialize _r_debug if it has not already been done. The argument is
> the run-time load address of the dynamic linker, to be put in
> _r_debug.r_ldbase. Returns the address of _r_debug. */
>
> struct r_debug *
> internal_function
> _dl_debug_initialize (ElfW(Addr) ldbase, Lmid_t ns)
> {
> struct r_debug *r;
>
> if (ns == LM_ID_BASE)
> r = &_r_debug;
> else
> r = &GL(dl_ns)[ns]._ns_debug;
>
> if (r->r_map == NULL || ldbase != 0)
>
> and thus 'r' being NULL.
I confirm your analysis. My code (dl-debug.c) is the same of yours.