The DebuggerThread was detecting the launch error, but it was ignored by ProcessWindows::DoLaunch, causing lldb to wait forever in the debugger loop.
Found while diagnosing test problems.
Differential D7874
Solve hang on Windows when lldb fails to launch the process amccarth on Feb 24 2015, 4:24 PM. Authored by
Details The DebuggerThread was detecting the launch error, but it was ignored by ProcessWindows::DoLaunch, causing lldb to wait forever in the debugger loop. Found while diagnosing test problems.
Diff Detail
Event TimelineComment Actions Interesting. The change looks correct. Out of curiosity, what was the error launching the process? based on the arguments that were used to attempt CreateProcess(), should the launch have succeeded under normal circumstances? Maybe we were launching a process with a bogus path or something? Comment Actions Yes, the case I debugged was specifying a non-existent working directory. For example: (lldb) process launch -w c:\does_not_exist At least one of the process_launch tests does this. The test also fails for other reasons, which I'm working on. Since I'd seen the hang myself when learning to use lldb interactively, I thought it was worth a separate fix. Comment Actions Ahh. So it was specifically testing that launching a process from a non-existant directory failed in the correct way? If it was testing something else, then that alone seems like a useful test to add. Comment Actions Yes, the test was explicitly trying to set the working directory of the The failure reported up is 0x0000010b, which corresponds to "The directory Comment Actions Yea, if you look at Error.h / Error.cpp, there's functions like SetError() and GetMessage(). Currently error strings are not reported at all unless you explicitly set a string. But there's no reason it couldn't ask the system to do the conversion if it's on a platform where the error code makes sense (depending on the category). Just hasn't been done yet, but it's definitely something we should do at some point. |