This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Export stack_used as __stack_used
- From: Pedro Alves <palves at redhat dot com>
- To: Florian Weimer <fweimer at redhat dot com>, Gary Benson <gbenson at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 17 Jun 2016 23:15:38 +0100
- Subject: Re: [PATCH] Export stack_used as __stack_used
- Authentication-results: sourceware.org; auth=none
- References: <20160613112351 dot GA655 at blade dot nx> <1466163476-10459-1-git-send-email-gbenson at redhat dot com> <f6867d8f-3532-1ac2-cc7f-e7bb6ea12202 at redhat dot com> <20160617195018 dot GA20374 at blade dot nx> <ce9c88a4-5709-707e-c598-d438198df85f at redhat dot com>
On 06/17/2016 09:17 PM, Florian Weimer wrote:
>
>>> If the variable remains nptl-internal, I expect that you could turn
>>> it into a hidden symbol, and keep its current name.
>>
>> I may be wrong but I think its the rename that fixes the GDB bug.
>
> Only if GDB explicitly searches for __stack_used (and that with the help
> of debugging information because it's not exported).
Note that it's not GDB that _wants_ to search for the symbol, it's
libthread_db.so itself. GDB just serves libthread_db.so's request,
through the proc_service [1] interface (nptl_db/proc_service.h). That is,
through callbacks that serve as interface between libthread_db and
the debugger that loads it.
[1] based on Solaris's interface of the same name:
http://docs.oracle.com/cd/E26505_01/html/816-5171/proc-service-3proc.html
>
> There isn't even a reference from libthread_db.
AFAICS, the look ups in question are here:
nptl_db/td_thr_validate.c:73: err = DB_GET_SYMBOL (list, th->th_ta_p, stack_used);
nptl_db/td_ta_thr_iter.c:164: err = DB_GET_SYMBOL (list, ta, stack_used);
I think that nptl_version is another symbol that can potentially
cause the same problem:
nptl_db/structs.def:51:DB_SYMBOL (stack_used)
nptl_db/structs.def:52:DB_SYMBOL (__stack_user)
nptl_db/structs.def:53:DB_SYMBOL (nptl_version)
nptl_db/structs.def:56:DB_SYMBOL (__nptl_threads_events)
(Obviously it's less likely, given the "nptl" prefix, but still...)
Thanks,
Pedro Alves