Bug 30512 - error when thread ends in GDB
Summary: error when thread ends in GDB
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gdb
Version: 7.0
Hardware: i386
OS: Linux
high
high
Target Milestone: ---
Assignee: Trond Eivind Glomsrxd
QA Contact: Aaron Brown
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-03-04 06:45 UTC by Ji ZhenYong
Modified: 2005-10-31 22:00 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-03-07 11:04:39 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2001:159 0 high SHIPPED_LIVE Updated gdb is available 2001-11-26 05:00:00 UTC

Description Ji ZhenYong 2001-03-04 06:45:37 UTC
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.

Comment 1 Jakub Jelinek 2001-03-07 11:04:29 UTC
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 19:58:53 UTC
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.