Under Debian GNU/Linux "unstable", with a Debian
2.6.22-1-686-bigmem kernel, the following program hangs GDB 6.7.1
(as packaged for Debian under Debian version number 6.7.1-1) if
one types control-C to break out to the debugger:

    #include <pthread.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>

    void *my_thread(void *foo) 
    {
        for (;;) {
            sleep(1);
            putchar('.');
            fflush(stdout);
        }
    }

    int main(void) 
    {
        pthread_t pth;
        pthread_create(&pth, NULL, my_thread, NULL);
        pthread_detach(pthread_self());
        pthread_exit(0);
    }

If the final two statements in main are changed to
        for (;;)
          pause();
then GDB can break out as expected.
-- 
Ben Pfaff 
http://benpfaff.org



_______________________________________________
bug-gdb mailing list
bug-gdb@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gdb

Reply via email to