From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) when a thread ends, GDB consider the program exited, i.e. I can't debug the codes after pthread_create. Reproducible: Always Steps to Reproduce: 1.create a new thread and wait it 2.the new thread ends 3.now GDB considers the program exited normally Actual Results: [...]$ cat main.c #include <stdlib.h> #include <stdio.h> #include <pthread.h> void MyProc() { printf( "MyProc : .......Thread : %d......\r\n", (int) pthread_self() ); } void *ThreadProc( void *pParam ) { printf( "ThreadProc : \r\n" ); MyProc(); return NULL; } int main(int argc, char *argv[]) { pthread_t aThread = 0; void *pRet = NULL; pthread_create( &aThread, NULL, ThreadProc, NULL ); MyProc(); pthread_join( aThread, &pRet ); printf( "Main : ...\r\n" ); return 0; } [...]$ gcc -lpthread -g -Wall -othread main.c [...]$ gdb ./thread GNU gdb 5.0 Copyright 2000 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"... (gdb) r Starting program: /home/jizy/./thread [New Thread 1024 (LWP 12127)] [New Thread 2049 (LWP 12128)] [New Thread 1026 (LWP 12129)] ThreadProc: MyProc : .......Thread : 1026...... Program exited normally. (gdb) q Expected Results: "Main : ..." and "MyProc : .......Thread : 1024......"should be outputed.
First of all, this is gdb issue and I cannot see why it should have severity security when it has nothing to do with security. I haven't been able to reproduce this with gdb-5.0rh-3, with gdb in 7.0 I haven't seen the behaviour you describe, but got some weird message every couple invocations, but that seems to be gone in current rawhide gdb.
It works with gdb-5.0rh-3 from Rawhide.