This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Threading bug, already solved, or is there a workaround?


Hello

> > I'm currently try to debug a multithreaded application with gdb. It seems
> > that there are this threading problems described in the PROBLEMS
> > document. (It's a SuSE 9.2, but i installed gdb 6.3 in the hope, the bug
> > is already solved.)
> >
> > Is there already a solution for that problem? Or is there a workaround?
>
> Which problem, specifically, do you mean?  What symptoms do you see?

If i try to debug an multithread application with gdb, the threads aren't 
started. Without gdb all is working fine.

An minimal example program for Qt with qmake.

The regular output would be:

**snip**
drzoom@toe:~/Entwicklung/kdevelopthreadbug/bin> ./kdevelopthreadbug
start 5 thread
Start thread 0
Start thread 1
Start thread 2
Start thread 3
Start thread 4
Thread started
Thread started
Thread started
Thread started
Thread started
Start thread 5
Start thread 6
Start thread 7
Start thread 8
Start thread 9
Thread started
Thread started
Thread started
Thread started
Thread started
5 threads are running...
Thread done
Thread done
Thread done
Thread done
Thread done
Thread done
Thread done
Thread done
Thread done
Thread done
**snip*

The output with the debugger is:

drzoom@toe:~/Entwicklung/kdevelopthreadbug/bin> /usr/bin/gdb kdevelopthreadbug
GNU gdb 6.2.1
Copyright 2004 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 "i586-suse-linux"...Using host libthread_db library 
"/lib/tls/libthread_db.so.1".

(gdb) r
Starting 
program: /home/drzoom/Entwicklung/kdevelopthreadbug/bin/kdevelopthreadbug
[Thread debugging using libthread_db enabled]
warning: Unable to set global thread event mask: generic error
[New Thread 1085896896 (LWP 6096)]
start 5 thread
Start thread 0
Start thread 1
Start thread 2
Start thread 3
Start thread 4
Start thread 5
Start thread 6
Start thread 7
Start thread 8
Start thread 9
5 threads are running...

I tried the same with gdb 6.1, 6.2.1 and with 6.3. Everywhere the same 
problem.

The example as attachement.

kind regards
Tobias

Attachment: bug.tar.gz
Description: application/tgz


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]