Bug 30512 - error when thread ends in GDB
error when thread ends in GDB
Product: Red Hat Linux
Classification: Retired
Component: gdb (Show other bugs)
i386 Linux
high Severity high
: ---
: ---
Assigned To: Trond Eivind Glomsrxd
Aaron Brown
Depends On:
  Show dependency treegraph
Reported: 2001-03-04 01:45 EST by Ji ZhenYong
Modified: 2005-10-31 17:00 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-03-07 06:04:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ji ZhenYong 2001-03-04 01:45:37 EST
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" );
	return NULL;

int main(int argc, char *argv[])
	pthread_t aThread = 0;
	void		*pRet = NULL;

	pthread_create( &aThread, NULL, ThreadProc, NULL );


	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 
welcome to change it and/or distribute copies of it under certain 
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)]
MyProc : .......Thread : 1026......

Program exited normally.
(gdb) q

Expected Results:  "Main : ..." and "MyProc : .......Thread : 
1024......"should be outputed.
Comment 1 Jakub Jelinek 2001-03-07 06:04:29 EST
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.
Comment 2 Trond Eivind Glomsrxd 2001-03-08 14:58:53 EST
It works with gdb-5.0rh-3 from Rawhide.

Note You need to log in before you can comment on or make changes to this bug.