From: "Mathieu Lacage" <mathieu.lacage@gmail.com>
To: "Mathieu Lacage" <mathieu.lacage@gmail.com>, gdb@sourceware.org
Subject: Re: weird errors when notifying gdb of linkmap changes
Date: Tue, 13 Jan 2009 09:45:00 -0000 [thread overview]
Message-ID: <74fef6df0901130144x1fe3cc5dm783b06f3fd9c5b1c@mail.gmail.com> (raw)
In-Reply-To: <20090112192841.GA4460@caradoc.them.org>
On Mon, Jan 12, 2009 at 8:28 PM, Daniel Jacobowitz <drow@false.org> wrote:
>> Starting program: /home/mathieu/code/elf-loader/ls
>> [Thread debugging using libthread_db enabled]
>> Error while reading shared library symbols:
>> Cannot find new threads: generic error
>> Cannot find new threads: generic error
>> (gdb) bt
>> #0 0xb7f228d1 in _r_debug_state () at gdb.c:10
>> #1 0xb7f22964 in gdb_notify () at gdb.c:36
>> #2 0xb7f1d7fd in stage2 (args=
>> {interpreter_load_base = 3086077952, program_phdr = 0x8048034,
>> program_phnum = 8, sysinfo = 3086074880, program_argc = 1,
>> program_argv = 0xbfa13ff4, program_envp = 0xbfa13ffc}) at ldso.c:253
>> #3 0xb7f1d9b0 in stage1 () at ldso.c:312
>> #4 0x00000001 in ?? ()
>>
>> I wonder if there is an obvious well-known reason for this.
>
> You'll have to build a debuggable libthread_db to figure out what it's
> complaining about. Most likely you have told it that the thread
> library is loaded, but provided some incorrect information that led to
> GDB not finding the thread library's data structures.
Ok. I looked a bit a this. What is happening is that I invoke
_r_debug_state _before_ calling the ELF initializers so,
__pthread_initialize_minimal has not been invoked yet so the data
structure for the main thread is not yet initialized so, nptl_db is
confused.
The bug https://bugzilla.redhat.com/show_bug.cgi?id=179072#c14 pointed
out by Jan sheds some light on a similar problem and points out that,
theoretically, the content of the libthread data structures is
parseable by libpthread_db _before_ _pthread_initialize_minimal is
called which would lead me to believe that I have screwed up something
in the memory layout of libpthread or something similar.
To summarize, I should be able to still call _r_debug_state _before_
calling __pthread_initialize_minimal but I have probably screwed up
something else.
bah, more debugging.
Mathieu
--
Mathieu Lacage <mathieu.lacage@gmail.com>
prev parent reply other threads:[~2009-01-13 9:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-12 19:20 Mathieu Lacage
2009-01-12 19:29 ` Daniel Jacobowitz
2009-01-13 9:45 ` Mathieu Lacage [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=74fef6df0901130144x1fe3cc5dm783b06f3fd9c5b1c@mail.gmail.com \
--to=mathieu.lacage@gmail.com \
--cc=gdb@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