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)
(deleted),
text/x-phabricator-request
|
Details |
Reporter | ||
Comment 1•6 years ago
|
||
Updated•6 years ago
|
Reporter | ||
Updated•6 years ago
|
Reporter | ||
Updated•6 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 2•5 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•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
Comment 5•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Description
•