While looking into supporting threaded debugging on FreeBSD I
discovered an issue in the Linux implementation.

ProcessPOSIX::SendMessage now looks up a POSIXThread in m_thread_list
by tid, but is called from ::MonitorCallback with the pid of the
process.  As it happens this usually works on Linux, because the first
(or only) thread's tid is equal to the pid, resulting in a successful
FindThreadByID.  However, this fails if the main thread exits.

I set up a Debian VM to explore this, and the test case below causes
lldb to hang.


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

void *
thread(void *arg)
{
        sleep(1);
        abort();
}

int
main(int argc, char *argv[])
{
        pthread_t td;
        pthread_create(&td, NULL, thread, NULL);
        pthread_exit(NULL);

        return 0;
}
_______________________________________________
lldb-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

Reply via email to