This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
gdb attach hang (w/pthreads on Cygwin)
- From: Brian Ford <ford at vss dot fsi dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 9 Jan 2003 14:45:30 -0600 (CST)
- Subject: gdb attach hang (w/pthreads on Cygwin)
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.
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;
}
Thanks.
--
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
Phone: 314-551-8460
Fax: 314-551-8444