Re: generic error with a statically linked multithreaded program

Atsushi Nemoto
2007-04-06T09:40:13Z

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.