Summary: | [Win] ASSERTION FAILED: ::DuplicateHandle failed with error 5 | ||
---|---|---|---|
Product: | WebKit | Reporter: | Fujii Hironori <Hironori.Fujii> |
Component: | Platform | Assignee: | Fujii Hironori <Hironori.Fujii> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Description
Fujii Hironori
2023-06-23 00:10:55 PDT
The error code 5 is ERROR_INVALID_HANDLE. It hasn't been observed for a while. But, it's happening again recently. Buildbot: builder WinCairo-64-bit-Debug-Tests build 21500 : 272148@main https://build.webkit.org/#/builders/727/builds/21500 Buildbot: builder WinCairo-64-bit-Debug-Tests build 21995 https://build.webkit.org/#/builders/727/builds/21995 fast/dom/Window/atob-btoa.html [ Crash ] https://results.webkit.org/?suite=layout-tests&test=fast%2Fdom%2FWindow%2Fatob-btoa.html&platform=wincairo&style=debug ASSERTION FAILED: ::DuplicateHandle failed with error 5 false C:\BW\WinCairo-64-bit-Debug-Build\build\Source\WebKit\Platform\IPC\win\ArgumentCodersWin.cpp(56) : decode 1 00007FF9035F1CA9 WTFCrash 2 00007FF8E93512C3 IPC::ArgumentCoder<WTF::Win32Handle,void>::decode 3 00007FF8E998B937 IPC::Decoder::decode<WTF::Win32Handle> 4 00007FF8E9925F72 IPC::ArgumentCoder<WebCore::SharedMemoryHandle,void>::decode 5 00007FF8E947AA27 IPC::Decoder::decode<WebCore::SharedMemoryHandle> 6 00007FF8E9904F41 IPC::ArgumentCoder<IPC::StreamServerConnectionHandle,void>::decode 7 00007FF8E945ACC7 IPC::Decoder::decode<IPC::StreamServerConnectionHandle> 8 00007FF8E945AAF2 IPC::ArgumentCoder<std::tuple<WebKit::RemoteRenderingBackendCreationParameters,IPC::StreamServerConnectionHandle>,void>::decode<IPC::Decoder,WebKit::RemoteRenderingBackendCreationParameters> 9 00007FF8E945A9D0 IPC::ArgumentCoder<std::tuple<WebKit::RemoteRenderingBackendCreationParameters,IPC::StreamServerConnectionHandle>,void>::decode<IPC::Decoder> 10 00007FF8E945A807 IPC::Decoder::decode<std::tuple<WebKit::RemoteRenderingBackendCreationParameters,IPC::StreamServerConnectionHandle> > 11 00007FF8E9459078 IPC::handleMessage<Messages::GPUConnectionToWebProcess::CreateRenderingBackend,WebKit::GPUConnectionToWebProcess,WebKit::GPUConnectionToWebProcess,void (WebKit::RemoteRenderingBackendCreationParameters &&, IPC::StreamServerConnectionHandle &&)> 12 00007FF8E9458697 WebKit::GPUConnectionToWebProcess::didReceiveMessage 13 00007FF8EA2642CA IPC::Connection::dispatchMessage 14 00007FF8EA264537 IPC::Connection::dispatchMessage 15 00007FF8EA26A7AD IPC::Connection::SyncMessageState::ConnectionAndIncomingMessage::dispatch 16 00007FF8EA25E332 IPC::Connection::SyncMessageState::dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection 17 00007FF8EA2648D6 IPC::Connection::dispatchSyncStateMessages 18 00007FF8EA265AAB IPC::Connection::SyncMessageState::processIncomingMessage::<lambda_0>::operator() 19 00007FF8EA265A47 WTF::Detail::CallableWrapper<`lambda at C:\BW\WinCairo-64-bit-Debug-Build\build\Source\WebKit\Platform/IPC/Connection.cpp:224:31',void>::call 20 00007FF903608814 WTF::Function<void ()>::operator() 21 00007FF90368DB6A WTF::RunLoop::performWork 22 00007FF903774510 WTF::RunLoop::wndProc 23 00007FF903774447 WTF::RunLoop::RunLoopWndProc 24 00007FF901660089 CallWindowProcW 25 00007FF90165FA02 DispatchMessageW 26 00007FF9037746ED WTF::RunLoop::run 27 00007FF8E9307453 WebKit::AuxiliaryProcessMainBase<WebKit::GPUProcess,1>::run 28 00007FF8E9307307 WebKit::AuxiliaryProcessMain<WebKit::GPUProcessMainWin> 29 00007FF8E93071E3 WebKit::GPUProcessMain 30 00007FF7D0EE124C main 31 00007FF7D0EE18BC __scrt_common_main_seh C:\BW\WinCairo-64-bit-Debug-Build\build\Source\WebKit\UIProcess/GPU/GPUProcessProxy.cpp(564) : didClose ERROR: 00000140A917D830 - GPUProcessProxy::gpuProcessExited: reason=Crash C:\BW\WinCairo-64-bit-Debug-Build\build\Source\WebKit\UIProcess/GPU/GPUProcessProxy.cpp(517) : gpuProcessExited GPUProcess terminated (pid 2640) for reason: crash #CRASHED - GPUProcess (pid 2640) This is reproducible with the following command on my PC.
> python .\Tools\Scripts\run-webkit-tests --wincairo --debug --iter=10000 --no-retry --exit-after-n-c=1 -f fast/dom/Window/a-rel-noopener.html
Adding Sleep after OpenProcess in ArgumentCoder<Win32Handle>::decode makes this crash highly reproducible. The web process is exiting after OpenProcess in another process. diff --git a/Source/WebKit/Platform/IPC/win/ArgumentCodersWin.cpp b/Source/WebKit/Platform/IPC/win/ArgumentCodersWin.cpp index 680fc1b577ac..2dff96d6ba12 100644 --- a/Source/WebKit/Platform/IPC/win/ArgumentCodersWin.cpp +++ b/Source/WebKit/Platform/IPC/win/ArgumentCodersWin.cpp @@ -50,6 +50,7 @@ std::optional<Win32Handle> ArgumentCoder<Win32Handle>::decode(Decoder& decoder) auto sourceProcess = Win32Handle::adopt(::OpenProcess(PROCESS_DUP_HANDLE, FALSE, *sourcePID)); if (!sourceProcess) return std::nullopt; + Sleep(100); HANDLE duplicatedHandle; // Copy the handle into our process and close the handle that the sending process created for us. if (!::DuplicateHandle(sourceProcess.get(), reinterpret_cast<HANDLE>(*sourceHandle), ::GetCurrentProcess(), &duplicatedHandle, 0, FALSE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE)) { Pull request: https://github.com/WebKit/WebKit/pull/29159 Committed 279361@main (279f09128a7c): <https://commits.webkit.org/279361@main> Reviewed commits have been landed. Closing PR #29159 and removing active labels. |