* debugging threads
@ 2007-09-30 3:21 Tim Michals
2007-09-30 3:57 ` Daniel Jacobowitz
2007-10-02 2:00 ` Tim Michals
0 siblings, 2 replies; 4+ messages in thread
From: Tim Michals @ 2007-09-30 3:21 UTC (permalink / raw)
To: gdb
Hello,
I'm trying to debug simple multithreaded app and get the following error:
[Thread debugging using libthread_db enabled]
Cannot find new threads: generic error
Can set break points and trace as shown below.
(gdb)
Here is the info..
GNU gdb Red Hat Linux (6.6-15.fc7rh)
Copyright (C) 2006 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 "i386-redhat-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) list
9 #include <iostream>
10
11 void helloworld(const char* who)
12 {
13 std::cout << who << "says, \"Hello World.\"" << std::endl;
14 }
15
16 int main()
17 {
18 boost::thread thrd(boost::bind(&helloworld, "Bob"));
(gdb) list
19 thrd.join();
20 }
21
(gdb) b main
Breakpoint 1 at 0x8048320: file ../helloworld.cpp, line 18.
(gdb) run
Starting program: /home/tcmichals/workspace/example/Debug/example
[Thread debugging using libthread_db enabled]
Cannot find new threads: generic error
(gdb) n
Single stepping until exit from function _start,
which has no line number information.
Cannot find user-level thread for LWP 3719: generic error
(gdb) n
Single stepping until exit from function _start,
which has no line number information.
Cannot find user-level thread for LWP 3719: generic error
The kernel version is:
Linux version 2.6.22.4-65.fc7 (kojibuilder@xenbuilder2.fedora.redhat.com)
(gcc v
ersion 4.1.2 20070502 (Red Hat 4.1.2-12)) #1 SMP Tue Aug 21 22:36:56 EDT
2007
Several posting on this issue i.e.
http://sourceware.org/ml/gdb/2007-08/msg00128.html
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: debugging threads
2007-09-30 3:21 debugging threads Tim Michals
@ 2007-09-30 3:57 ` Daniel Jacobowitz
2007-10-02 2:00 ` Tim Michals
1 sibling, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2007-09-30 3:57 UTC (permalink / raw)
To: Tim Michals; +Cc: gdb
On Sat, Sep 29, 2007 at 09:59:56PM -0500, Tim Michals wrote:
> GNU gdb Red Hat Linux (6.6-15.fc7rh)
This is a Red Hat version of GDB...
> The kernel version is:
> Linux version 2.6.22.4-65.fc7 (kojibuilder@xenbuilder2.fedora.redhat.com)
... and this is a Red Hat prebuilt kernel. Normally they work
together fine. Maybe someon on a Fedora list will know why they don't
in your case.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: debugging threads
2007-09-30 3:21 debugging threads Tim Michals
2007-09-30 3:57 ` Daniel Jacobowitz
@ 2007-10-02 2:00 ` Tim Michals
2007-10-02 2:46 ` Daniel Jacobowitz
1 sibling, 1 reply; 4+ messages in thread
From: Tim Michals @ 2007-10-02 2:00 UTC (permalink / raw)
To: gdb
I've narrowed the issue down it to using -static gcc option version shared
libraries
For example:
Ok, this might be a user error, but... I did exactly what you did and yes it
worked. I'm using the latest and greatest from boost cvs. So mine is in
/usr/local/lib... So using that library and changing the path ...
[tcmichals@localhost examples]$ g++ -o helloworld helloworld.cpp -Wall
-ggdb2 -
pthread -L/usr/local/lib -lboost_thread-gcc41-mt-d
[tcmichals@localhost examples]$ export LD_LIBRARY_PATH=/usr/local/lib
[tcmichals@localhost examples]$ gdb helloworld
GNU gdb Red Hat Linux (6.6-15.fc7rh)
Copyright (C) 2006 Free Software Foundation, Inc.
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) b main
Breakpoint 1 at 0x8048a78: file helloworld.cpp, line 17.
(gdb) start
Breakpoint 2 at 0x8048a78: file helloworld.cpp, line 17.
Starting program: /home/tcmichals/examples/helloworld
[Thread debugging using libthread_db enabled]
[New Thread -1209014576 (LWP 2826)]
[Switching to Thread -1209014576 (LWP 2826)]
Breakpoint 1, main () at helloworld.cpp:17
17 boost::thread thrd(&helloworld);
(gdb)
It worked!!!
ok if I do the following:
The program is running. Exit anyway? (y or n) y
[tcmichals@localhost examples]$ g++ -static -o helloworld helloworld.cpp
-Wall
-ggdb2 -pthread -L/usr/local/lib -lboost_thread-gcc41-mt-d
[tcmichals@localhost examples]$
[tcmichals@localhost examples]$ ls /usr/local/lib/libboost_thread*
/usr/local/lib/libboost_thread-gcc41-mt-1_35.a
/usr/local/lib/libboost_thread-gcc41-mt-1_35.so
/usr/local/lib/libboost_thread-gcc41-mt-1_35.so.1.35.0
/usr/local/lib/libboost_thread-gcc41-mt.a
/usr/local/lib/libboost_thread-gcc41-mt-d-1_35.a
/usr/local/lib/libboost_thread-gcc41-mt-d-1_35.so
/usr/local/lib/libboost_thread-gcc41-mt-d-1_35.so.1.35.0
/usr/local/lib/libboost_thread-gcc41-mt-d.a
/usr/local/lib/libboost_thread-gcc41-mt-d.so
/usr/local/lib/libboost_thread-gcc41-mt.so
[tcmichals@localhost examples]$ gdb helloworld
GNU gdb Red Hat Linux (6.6-15.fc7rh)
Copyright (C) 2006 Free Software Foundation, Inc.
This GDB was configured as "i386-redhat-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) b main
Breakpoint 1 at 0x80482ac: file helloworld.cpp, line 17.
(gdb) start
Breakpoint 2 at 0x80482ac: file helloworld.cpp, line 17.
Starting program: /home/tcmichals/examples/helloworld
[Thread debugging using libthread_db enabled]
Cannot find new threads: generic error
(gdb)
Then I try to exit gdb and it locks up... But I thought -static links the
static library?
well, now atleast I know what the difference is and the issue, but don't
know why.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: debugging threads
2007-10-02 2:00 ` Tim Michals
@ 2007-10-02 2:46 ` Daniel Jacobowitz
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2007-10-02 2:46 UTC (permalink / raw)
To: Tim Michals; +Cc: gdb
On Mon, Oct 01, 2007 at 09:00:11PM -0500, Tim Michals wrote:
> I've narrowed the issue down it to using -static gcc option version shared
> libraries
You need a current CVS snapshot of both gdb and glibc to debug static
applications using NPTL. It won't be fixed until GDB 6.7 and GLIBC
2.7.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-10-02 2:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-30 3:21 debugging threads Tim Michals
2007-09-30 3:57 ` Daniel Jacobowitz
2007-10-02 2:00 ` Tim Michals
2007-10-02 2:46 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox