* generic error with a statically linked multithreaded program
@ 2007-04-05 5:58 Atsushi Nemoto
2007-04-05 10:51 ` Atsushi Nemoto
2007-04-05 14:29 ` Daniel Jacobowitz
0 siblings, 2 replies; 7+ messages in thread
From: Atsushi Nemoto @ 2007-04-05 5:58 UTC (permalink / raw)
To: gdb
I found gdb can not run a statically linked multithreaded program on
Fedora Core 6.
Tested with gdb 6.5-15.fc6rh (FC6), gdb-6.6 vanilla and
gdb-6.6.50.20070405 snapshot. All behave same.
$ gcc -o ./hello -g hello.c -lpthread -static
$ gdb-6.6.50.20070405/gdb/gdb ./hello
GNU gdb 6.6.50.20070405
Copyright (C) 2007 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run
Starting program: ./hello
[Thread debugging using libthread_db enabled]
Cannot find new threads: generic error
(gdb)
And gdb can not exit normally with "quit" command.
(gdb) quit
The program is running. Exit anyway? (y or n) y
Then gdb hangs. At this point, the target program is still stopped.
$ ps l
F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND
0 11389 12286 3594 20 0 8628 3332 wait S+ pts/2 0:00 gdb-6.6.50.20070405/gdb/gdb ./hello
0 11389 12287 12286 15 0 10960 140 utrace Tl pts/2 0:00 ./hello
--- hello.c ---
#include <stdio.h>
#include <pthread.h>
void *func(void *data)
{
return NULL;
}
int main(int argc, char **argv)
{
pthread_t tid;
pthread_create(&tid, NULL, func, NULL);
printf("hello world\n");
pthread_join(tid, NULL);
return 0;
}
--- --- ---
My environment is:
kernel-2.6.20-1.2933.fc6
glibc-2.5-10.fc6
gcc-4.1.1-51.fc6
If I compiled the program without -static, gdb can run it normally.
Is this gdb problem, or limitation, or problem at somewhere else?
---
Atsushi Nemoto
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: generic error with a statically linked multithreaded program
2007-04-05 5:58 generic error with a statically linked multithreaded program Atsushi Nemoto
@ 2007-04-05 10:51 ` Atsushi Nemoto
2007-04-05 14:29 ` Daniel Jacobowitz
1 sibling, 0 replies; 7+ messages in thread
From: Atsushi Nemoto @ 2007-04-05 10:51 UTC (permalink / raw)
To: gdb
On Thu, 05 Apr 2007 14:58:06 +0900 (JST), Atsushi Nemoto <anemo@mba.ocn.ne.jp> wrote:
> I found gdb can not run a statically linked multithreaded program on
> Fedora Core 6.
And here is an output with debug lin-lwp.
(gdb) set debug lin-lwp 1
(gdb) run
Starting program: ./hello
LLW: waitpid 12681 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in process 12681.
LLTA: PTRACE_PEEKUSER process 12681, 0, 0 (OK)
LLW: trap_ptid is process 12681.
LLR: Preparing to resume process -1, 0, inferior_ptid process -1
LLR: PTRACE_CONT process 12681, 0 (resume event thread)
LLW: waitpid 12681 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in process 12681.
LLTA: PTRACE_PEEKUSER process 12681, 0, 0 (OK)
LLW: trap_ptid is process 12681.
[Thread debugging using libthread_db enabled]
Cannot find new threads: generic error
(gdb) quit
The program is running. Exit anyway? (y or n) y
KC: PTRACE_KILL process 12681, 0, 0 (OK)
KWC: wait process 12681 received unk.
Then gdb hangs.
---
Atsushi Nemoto
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: generic error with a statically linked multithreaded program
2007-04-05 5:58 generic error with a statically linked multithreaded program Atsushi Nemoto
2007-04-05 10:51 ` Atsushi Nemoto
@ 2007-04-05 14:29 ` Daniel Jacobowitz
2007-04-05 14:39 ` Atsushi Nemoto
1 sibling, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2007-04-05 14:29 UTC (permalink / raw)
To: Atsushi Nemoto; +Cc: gdb
On Thu, Apr 05, 2007 at 02:58:06PM +0900, Atsushi Nemoto wrote:
> I found gdb can not run a statically linked multithreaded program on
> Fedora Core 6.
Please see the glibc bugzilla for more information about this. I've
been waiting for a long time to hear back from them...
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: generic error with a statically linked multithreaded program
2007-04-05 14:29 ` Daniel Jacobowitz
@ 2007-04-05 14:39 ` Atsushi Nemoto
2007-04-05 14:45 ` Daniel Jacobowitz
0 siblings, 1 reply; 7+ messages in thread
From: Atsushi Nemoto @ 2007-04-05 14:39 UTC (permalink / raw)
To: drow; +Cc: gdb
On Thu, 5 Apr 2007 10:29:13 -0400, Daniel Jacobowitz <drow@false.org> wrote:
> > I found gdb can not run a statically linked multithreaded program on
> > Fedora Core 6.
>
> Please see the glibc bugzilla for more information about this. I've
> been waiting for a long time to hear back from them...
Thank you.
Is it http://sources.redhat.com/bugzilla/show_bug.cgi?id=2696, right?
If so, the gdb patch mentioned in it is already merged in gdb 6.6?
---
Atsushi Nemoto
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: generic error with a statically linked multithreaded program
2007-04-05 14:39 ` Atsushi Nemoto
@ 2007-04-05 14:45 ` Daniel Jacobowitz
2007-04-06 9:40 ` Atsushi Nemoto
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2007-04-05 14:45 UTC (permalink / raw)
To: Atsushi Nemoto; +Cc: gdb
On Thu, Apr 05, 2007 at 11:39:33PM +0900, Atsushi Nemoto wrote:
> On Thu, 5 Apr 2007 10:29:13 -0400, Daniel Jacobowitz <drow@false.org> wrote:
> > > I found gdb can not run a statically linked multithreaded program on
> > > Fedora Core 6.
> >
> > Please see the glibc bugzilla for more information about this. I've
> > been waiting for a long time to hear back from them...
>
> Thank you.
> Is it http://sources.redhat.com/bugzilla/show_bug.cgi?id=2696, right?
>
> If so, the gdb patch mentioned in it is already merged in gdb 6.6?
I think so, but I don't remember for sure.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: generic error with a statically linked multithreaded program
2007-04-05 14:45 ` Daniel Jacobowitz
@ 2007-04-06 9:40 ` Atsushi Nemoto
2007-04-19 9:19 ` Atsushi Nemoto
0 siblings, 1 reply; 7+ messages in thread
From: Atsushi Nemoto @ 2007-04-06 9:40 UTC (permalink / raw)
To: drow; +Cc: gdb
On Thu, 5 Apr 2007 10:45:33 -0400, Daniel Jacobowitz <drow@false.org> wrote:
> > Thank you.
> > Is it http://sources.redhat.com/bugzilla/show_bug.cgi?id=2696, right?
> >
> > If so, the gdb patch mentioned in it is already merged in gdb 6.6?
>
> I think so, but I don't remember for sure.
I tried the libc patch on MIPS and it works fine with gdbserver.
But with MIPS native gdb, I got a little bit different error message:
thread_get_info_callback: cannot get thread info: generic error
Do you have any thoughts on this error?
# ./gdb ./hello
GNU gdb 6.6.50.20070405
Copyright (C) 2007 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "mips-linux"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) set debug lin-lwp 1
(gdb) run
Starting program: /hello
LLW: waitpid 741 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in process 741.
LLTA: PTRACE_PEEKUSER process 741, 0, 0 (OK)
LLW: trap_ptid is process 741.
LLR: Preparing to resume process 741, 0, inferior_ptid process 741
LLR: PTRACE_CONT process 741, 0 (resume event thread)
LLW: waitpid 741 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in process 741.
LLTA: PTRACE_PEEKUSER process 741, 0, 0 (OK)
LLW: trap_ptid is process 741.
[Thread debugging using libthread_db enabled]
LLR: Preparing to resume process 741, 0, inferior_ptid process 741
LLR: PTRACE_CONT process 741, 0 (resume event thread)
LLW: waitpid 741 received Trace/breakpoint trap (stopped)
LLW: Candidate event Trace/breakpoint trap (stopped) in process 741.
LLTA: PTRACE_PEEKUSER process 741, 0, 0 (OK)
LLW: trap_ptid is process 741.
thread_get_info_callback: cannot get thread info: generic error
(gdb) quit
The program is running. Exit anyway? (y or n) y
KC: PTRACE_KILL process 741, 0, 0 (OK)
KWC: wait process 741 received unk.
#
And gdb did not hang in this case. No problem with dynamically-linked
program.
---
Atsushi Nemoto
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: generic error with a statically linked multithreaded program
2007-04-06 9:40 ` Atsushi Nemoto
@ 2007-04-19 9:19 ` Atsushi Nemoto
0 siblings, 0 replies; 7+ messages in thread
From: Atsushi Nemoto @ 2007-04-19 9:19 UTC (permalink / raw)
To: drow; +Cc: gdb
On Fri, 06 Apr 2007 18:38:44 +0900 (JST), Atsushi Nemoto <anemo@mba.ocn.ne.jp> wrote:
> > > Is it http://sources.redhat.com/bugzilla/show_bug.cgi?id=2696, right?
> > >
> > > If so, the gdb patch mentioned in it is already merged in gdb 6.6?
> >
> > I think so, but I don't remember for sure.
>
> I tried the libc patch on MIPS and it works fine with gdbserver.
>
> But with MIPS native gdb, I got a little bit different error message:
> thread_get_info_callback: cannot get thread info: generic error
>
> Do you have any thoughts on this error?
...
> thread_get_info_callback: cannot get thread info: generic error
I have tracked down this error and I found that your last patch titled
"RFC: Handle early debugging in NPTL applications"
(http://sourceware.org/ml/gdb-patches/2006-02/msg00496.html) is not
merged yet. With this patch applied, I can debug NPTL static program
with native gdb.
---
Atsushi Nemoto
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-04-19 9:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-05 5:58 generic error with a statically linked multithreaded program Atsushi Nemoto
2007-04-05 10:51 ` Atsushi Nemoto
2007-04-05 14:29 ` Daniel Jacobowitz
2007-04-05 14:39 ` Atsushi Nemoto
2007-04-05 14:45 ` Daniel Jacobowitz
2007-04-06 9:40 ` Atsushi Nemoto
2007-04-19 9:19 ` Atsushi Nemoto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox