* weird errors when notifying gdb of linkmap changes
@ 2009-01-12 19:20 Mathieu Lacage
2009-01-12 19:29 ` Daniel Jacobowitz
0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Lacage @ 2009-01-12 19:20 UTC (permalink / raw)
To: gdb
hi,
I get the following errors:
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.
Mathieu
--
Mathieu Lacage <mathieu.lacage@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: weird errors when notifying gdb of linkmap changes
2009-01-12 19:20 weird errors when notifying gdb of linkmap changes Mathieu Lacage
@ 2009-01-12 19:29 ` Daniel Jacobowitz
2009-01-13 9:45 ` Mathieu Lacage
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2009-01-12 19:29 UTC (permalink / raw)
To: Mathieu Lacage; +Cc: gdb
On Mon, Jan 12, 2009 at 08:20:01PM +0100, Mathieu Lacage wrote:
> hi,
>
> I get the following errors:
> 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.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: weird errors when notifying gdb of linkmap changes
2009-01-12 19:29 ` Daniel Jacobowitz
@ 2009-01-13 9:45 ` Mathieu Lacage
0 siblings, 0 replies; 3+ messages in thread
From: Mathieu Lacage @ 2009-01-13 9:45 UTC (permalink / raw)
To: Mathieu Lacage, gdb
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>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-01-13 9:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-12 19:20 weird errors when notifying gdb of linkmap changes Mathieu Lacage
2009-01-12 19:29 ` Daniel Jacobowitz
2009-01-13 9:45 ` Mathieu Lacage
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox