Red Hat Bugzilla – Bug 27311
gdb can't handle more than 32 pthreads
Last modified: 2007-03-26 23:40:57 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.75 [en] (X11; U; Linux 2.2.16-22 i686)
GDB craps out with more than 32 pthreads. See the "Steps to Reproduce".
Steps to Reproduce:
Compile this program and just try to run it under gdb:
/* compile with cc -o pthread_test pthread_test.c -lpthread */
void *pthread_test(void *);
Actual Results: GDB says:
"Cannot find thread 33: invalid thread handle"
Expected Results: The darn thing should have allowed all 100 threads to be
it should have allowed me to debug them.
This has been broken for a while (you can reproduce it on earlier
I keep hoping that it'll get fixed in one of these releases or patches; but
just festering. I'm hoping that was for lack of an official bug report.
GDB has plenty of problems with pthreads....
> GDB has plenty of problems with pthreads....
OK, I can believe that. But I don't know
what your point is. Could you clarify?
Kevin Buettner has proposed a patch for this. It is non-trivial and has not yet
been merged into the main source tree. You can find his patch at:
This issue will be fixed when the patch mentioned above is merged into gdb. You
can apply it localy, if you need it now.
I applied the patch to a more recent copy of gdb, and it seems to do the trick,
(though as was mentioned there are lots of other bugs with gdb+pthreads).
Thanks very much.
This was closed as deferred for RHL 7.1 - the changes has been added to GDB CVS
since then, however.
*** This bug has been marked as a duplicate of 39070 ***