public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: libc-alpha@sourceware.org,  gdb-patches@sourceware.org,
	 Emil Velikov <emil.l.velikov@gmail.com>,
	 Kevin Buettner <kevinb@redhat.com>,
	 Pedro Alves <palves@redhat.com>
Subject: Re: [PATCH glibc] nptl_db: different libpthread/ld.so load orders (bug 27744)
Date: Fri, 16 Apr 2021 18:12:58 +0200	[thread overview]
Message-ID: <87k0p2nr79.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <73b32cc6-e201-8bac-e442-e3dddcc01e0d@polymtl.ca> (Simon Marchi's message of "Fri, 16 Apr 2021 12:07:53 -0400")

* Simon Marchi:

> On 2021-04-16 11:56 a.m., Florian Weimer wrote:
>> libthread_db is loaded once GDB encounters libpthread, and at this
>> point, ld.so may not have been loaded yet.

> Can this state (libpthread loaded, ld.so not loaded) really happen
> during the normal lifetime of a process?  My understanding is that this
> state happens when attaching only because GDB reads the shared libraries
> from the process in an undefined order, so libpthread may be discovered
> before ld.so.  So we present to libthread_db a state that doesn't really
> make sense.

I think it depends on the order of the link map list, I think, and there
ld.so ends up being sorted last.

If libpthread gets merged into libc for glibc 2.34, I will try to make
this work with old GDB by adding a fake libpthread.so.0 at the end of
the link map list, after ld.so.  But none of this code exists yet, so
it's impossible to know if it actually will work as expected.

Thanks,
Florian


  reply	other threads:[~2021-04-16 16:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-16 15:56 Florian Weimer
2021-04-16 16:07 ` Simon Marchi
2021-04-16 16:12   ` Florian Weimer [this message]
2021-04-16 16:25   ` Pedro Alves
2021-04-16 16:28     ` Florian Weimer
2021-04-16 16:33       ` Pedro Alves
2021-04-16 16:43         ` Florian Weimer
2021-04-16 16:47           ` Pedro Alves
2021-04-16 16:53             ` Simon Marchi
2021-04-16 17:18               ` Pedro Alves
2021-04-16 17:26                 ` Florian Weimer
2021-04-16 17:33                 ` Simon Marchi
2021-04-16 18:29                   ` Pedro Alves
2021-04-16 18:35                   ` Florian Weimer
2021-04-16 17:28             ` Florian Weimer
2021-04-16 17:43               ` Pedro Alves
2021-04-19  9:06                 ` Florian Weimer

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=87k0p2nr79.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=emil.l.velikov@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=palves@redhat.com \
    --cc=simon.marchi@polymtl.ca \
    /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).