This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
threads/1048: attach impossible on Cygwin if main thread exits
- From: ford at vss dot fsi dot com
- To: gdb-gnats at sources dot redhat dot com
- Date: 11 Feb 2003 23:45:07 -0000
- Subject: threads/1048: attach impossible on Cygwin if main thread exits
- Reply-to: ford at vss dot fsi dot com
>Number: 1048
>Category: threads
>Synopsis: attach impossible on Cygwin if main thread exits
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Feb 11 23:48:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Brian Ford
>Release: GNU gdb 5.3
>Organization:
>Environment:
>Description:
gdb on Cygwin can not attach to a running process if the main thread has exited via a call to pthread_exit(). The attach just hangs.
>How-To-Repeat:
Here is the test case: w/o GDB_HANG defined, all is well; with GDB_HANG defined, attaching is not possible.
#include <pthread.h>
#include <unistd.h>
void *
spinner(void *v)
{
for (;;) sleep(500);
return NULL;
}
int
main(void)
{
pthread_t tid;
pthread_create(&tid, NULL, spinner, NULL);
#ifdef GDB_HANG
pthread_exit(NULL);
#else
for (;;) sleep(500);
#endif
return 0;
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: