With a debugger attached, debug builds laucher process hangs at shutdown (WaitForInputIdle always returns WAIT_FAILED and GetLastError() == ERROR_NOT_GUI_PROCESS)
Categories
(Core :: Widget: Win32, defect, P3)
Tracking
()
People
(Reporter: mayhemer, Assigned: agashlin)
References
Details
Attachments
(1 file)
No description provided.
Reporter | ||
Comment 1•6 years ago
|
||
Causing WaitForInputIdle to just loop. The console has to be manually closed when the launcher is the last process running to end the debugger session "gracefully." ERROR_NOT_GUI_PROCESS docs don't say much :/
Updated•5 years ago
|
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Updated•5 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
I noticed something similar when diagnosing bug 1606414, this seems to affect ASAN builds in particular when updating. Without the debugger attached there's a 10 second timeout, but by then the updater has already finished waiting for the main process to exit.
I think the issue is that ::WaitForInputIdle()
doesn't always set the last-error code when it returns WAIT_FAILED
. The documentation never claims it does, which I missed in the review for bug 1477402. In particular, when it's given a handle to an exited process, it leaves the error unchanged.
As for why this would happen with ASAN and debug, maybe because the main process sits there far longer without any idle time, or before it becomes non-GUI. I expect it could happen on a normal build, so it'll be a good thing to fix anyway.
A simple fix is to call ::SetLastError(0)
before calling ::WaitForInputIdle()
, these try builds seem to bear out that it works: before and after.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
Pushed by agashlin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/70d3568ea54f Clear last-error code before WaitForInputIdle r=aklotz
Comment 5•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Description
•