public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Florian Weimer <fw@deneb.enyo.de>, gdb-patches@sourceware.org
Cc: Simon Marchi via Libc-alpha <libc-alpha@sourceware.org>
Subject: Re: [PATCH] nptl: Move stack list variables into _rtld_global
Date: Mon, 29 Mar 2021 10:29:34 -0400	[thread overview]
Message-ID: <8475264b-5986-6288-fd83-0eacb8934a8b@polymtl.ca> (raw)
In-Reply-To: <87a6qmwejx.fsf@mid.deneb.enyo.de>

On 2021-03-29 4:26 a.m., Florian Weimer wrote:> * Florian Weimer via Gdb-patches:
> 
>> * Simon Marchi:
>>
>>>>> If we have to deal with this, I guess that GDB should now do things in a
>>>>> different order: go through the whole library list and load their
>>>>> symbols.  And then if one of those libraries were libpthread, try to
>>>>> initialize libthread_db.
>>>>
>>>> Initialization of libthread_db should be unconditional.  Programs use
>>>> TLS data without linking against libpthread.  And glibc 2.34 might not
>>>> have a separate libpthread at all.
>>>
>>> Ok, currently GDB attempts to load libthread_db when noticing the main
>>> objfile / program (I guess it is needed if the program is statically
>>> linked to libpthread?) or when seeing a library named libpthread*.
>>
>> Would it be possible to load libthread_db unconditionally after loading
>> all shared objects?  Then it is loaded only once.
>>
>>> About the hypothetical scenario for glibc 2.34: do you mean that the
>>> pthread infrastructure will directly be in libc.so?  If so, our current
>>> strategy of attempting to load libthread_db only for the main program
>>> or a libpthread* library will indeed not work.  And I suppose that will
>>> also require trying to load libthread_db on every new shared lib...
>>
>> I think one attempt loading is enough, after all shared objects are
>> available.  In both the attaching and starting case, libpthread will be
>> seen by libthread_db if it is there.  I do not think it is necessary to
>> try loading libpthread_db again for each dlopen.  Maybe you could
>> restrict that to trigger on libpthread, but then dlopen of libpthread
>> does not really work today.
> 
> I would appreciate if we could make some progress on this issue.
> Please let me know if you need glibc test builds or something in that
> area.  Thanks.

Hi Florian,

I'll try to look into it, but I can't promise anything as I have nearly
zero free / personal time for GDB these days.

Simon

      reply	other threads:[~2021-03-29 14:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13 15:10 Florian Weimer
2020-11-16 18:02 ` Adhemerval Zanella
2021-03-05 16:54 ` Simon Marchi
2021-03-05 17:15   ` Florian Weimer
2021-03-05 17:26     ` Andreas Schwab
2021-03-05 17:58     ` Simon Marchi
2021-03-05 18:03       ` Florian Weimer
2021-03-05 18:45         ` Simon Marchi
2021-03-05 19:00           ` Florian Weimer
2021-03-29  8:26             ` Florian Weimer
2021-03-29 14:29               ` Simon Marchi [this message]

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=8475264b-5986-6288-fd83-0eacb8934a8b@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=fw@deneb.enyo.de \
    --cc=gdb-patches@sourceware.org \
    --cc=libc-alpha@sourceware.org \
    /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).