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". Reproducible: Always Steps to Reproduce: Compile this program and just try to run it under gdb: /* compile with cc -o pthread_test pthread_test.c -lpthread */ #include <pthread.h> void *pthread_test(void *); main() { int i; pthread_t tid; for(i=0;i<100;i++) { pthread_create(&tid,NULL,pthread_test,NULL); } } void * pthread_test(void *arg) { sleep(100); } Actual Results: GDB says: "Cannot find thread 33: invalid thread handle" Expected Results: The darn thing should have allowed all 100 threads to be created, and it should have allowed me to debug them. This has been broken for a while (you can reproduce it on earlier releases). I keep hoping that it'll get fixed in one of these releases or patches; but it's 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? Thanks.
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: http://sources.redhat.com/ml/gdb-patches/2000-10/msg00014.html
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 ***