This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

threads/1048: attach impossible on Cygwin if main thread exits


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]