[lldb-dev] lldb hangs during reverse-connect if lldb-server dies

Ted Woodward ted.woodward at codeaurora.org
Wed Jun 17 11:32:30 PDT 2015


With reverse-connect, lldb gets a port from the OS, spawns a listen thread
using the port, and launches lldb-server/debugserver, telling it to connect
back to lldb. lldb with then join with the listen thread. The listen thread
calls accept() to wait for the server to connect back to it.


On Linux (and possibly other OSes), if lldb-server dies or quits before
connecting, lldb will hang. It sits waiting for accept() to return, but it
never will.


If the child dies, the listen thread should be killed, and an error returned
to the user.



This is easily seen on Linux. Simply point to an alternate debugserver. Set
LLDB_DEBUGSERVER_PATH to something else, say /bin/ls. This will finish and
never connect back to lldb.


-> setenv LLDB_DEBUGSERVER_PATH /bin/ls

->bin/lldb /bin/ls

(lldb) target create "/bin/ls"

Current executable set to '/bin/ls' (x86_64).

(lldb) r





Qualcomm Innovation Center, Inc.

The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a
Linux Foundation Collaborative Project


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150617/497fdd5c/attachment.html>

More information about the lldb-dev mailing list