Bug 220450 - [Win][DumpRenderTree] ASSERT(!m_channel) failed in WebSocket::contextDestroyed
Summary: [Win][DumpRenderTree] ASSERT(!m_channel) failed in WebSocket::contextDestroyed
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fujii Hironori
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-01-07 17:42 PST by Fujii Hironori
Modified: 2021-01-18 16:14 PST (History)
4 users (show)

See Also:


Attachments
construct-in-detached-frame-crash-log.txt (133.59 KB, text/plain)
2021-01-07 17:45 PST, Fujii Hironori
no flags Details
WIP patch (909 bytes, patch)
2021-01-07 23:34 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (2.31 KB, patch)
2021-01-11 12:10 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (3.95 KB, patch)
2021-01-11 22:22 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (5.28 KB, patch)
2021-01-13 22:27 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (5.34 KB, patch)
2021-01-13 22:38 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (3.33 KB, patch)
2021-01-14 16:13 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (3.87 KB, patch)
2021-01-14 16:31 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (3.90 KB, patch)
2021-01-14 22:53 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (3.88 KB, patch)
2021-01-17 13:29 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (4.04 KB, patch)
2021-01-17 16:07 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2021-01-07 17:42:08 PST
[WinCairo][curl] ASSERT(!m_channel) failed in WebSocket::contextDestroyed

randomly failing by running http/tests/websocket/tests tests.

WinCairo-64-bit-WKL-Debug-Tests is frequently reproducing the crash in http/tests/websocket/tests/hybi/alert-in-event-handler.html
https://results.webkit.org/?suite=layout-tests&test=http%2Ftests%2Fwebsocket%2Ftests%2Fhybi%2Falert-in-event-handler.html
However, I can't reproduce it on my PC.

On my PC, the following command can reproduce the assertion failure.
python ./Tools/Scripts/run-webkit-tests --wincairo --debug  --no-new-test-results -1 --iterations=2 http/tests/websocket/construct-in-detached-frame.html
Comment 1 Fujii Hironori 2021-01-07 17:45:42 PST
Created attachment 417233 [details]
construct-in-detached-frame-crash-log.txt

 # Child-SP          RetAddr           Call Site
00 000000df`99cfd730 00007fff`6030db31 WTF!WTFCrash(void)+0x1f [C:\home\webkit\gc\Source\WTF\wtf\Assertions.cpp @ 295]
01 000000df`99cfd760 00007fff`623983fe WebKit!WTFCrashWithInfo(int __formal = 0n509, char * __formal = 0x00007fff`6b69f9a0 "C:\home\webkit\gc\Source\WebCore\Modules/websockets/WebSocket.cpp", char * __formal = 0x00007fff`6b69f418 "WebCore::WebSocket::contextDestroyed", int __formal = 0n2370)+0x31 [C:\home\webkit\gc\WebKitBuild\Debug\WTF\Headers\wtf\Assertions.h @ 672]
02 000000df`99cfd790 00007fff`62dbb292 WebKit!WebCore::WebSocket::contextDestroyed(void)+0x9e [C:\home\webkit\gc\Source\WebCore\Modules\websockets\WebSocket.cpp @ 509]
03 000000df`99cfd7c0 00007fff`62b9504c WebKit!WebCore::ScriptExecutionContext::~ScriptExecutionContext(void)+0x152 [C:\home\webkit\gc\Source\WebCore\dom\ScriptExecutionContext.cpp @ 175]
04 000000df`99cfd840 00007fff`63098fb9 WebKit!WebCore::Document::~Document(void)+0x154c [C:\home\webkit\gc\Source\WebCore\dom\Document.cpp @ 724]
05 000000df`99cfd8e0 00007fff`630a416c WebKit!WebCore::HTMLDocument::~HTMLDocument(void)+0xb9 [C:\home\webkit\gc\Source\WebCore\html\HTMLDocument.cpp @ 99]
06 000000df`99cfd910 00007fff`62c51687 WebKit!WebCore::HTMLDocument::`scalar deleting destructor'(void)+0x2c
07 000000df`99cfd940 00007fff`62b9531d WebKit!WebCore::Document::decrementReferencingNodeCount(void)+0x107 [C:\home\webkit\gc\Source\WebCore\dom\Document.h @ 375]
08 000000df`99cfd990 00007fff`62d34ca0 WebKit!WebCore::Document::removedLastRef(void)+0x29d [C:\home\webkit\gc\Source\WebCore\dom\Document.cpp @ 777]
09 000000df`99cfd9e0 00007fff`603a792d WebKit!WebCore::Node::removedLastRef(void)+0xa0 [C:\home\webkit\gc\Source\WebCore\dom\Node.cpp @ 2551]
0a 000000df`99cfda30 00007fff`60d4f66e WebKit!WebCore::Node::deref(void)+0x22d [C:\home\webkit\gc\WebKitBuild\Debug\WebCore\PrivateHeaders\WebCore\Node.h @ 801]
0b 000000df`99cfda70 00007fff`62c24910 WebKit!WTF::Ref<WebCore::Document,WTF::RawPtrTraits<WebCore::Document> >::~Ref<WebCore::Document,WTF::RawPtrTraits<WebCore::Document> >(void)+0x3e [C:\home\webkit\gc\WebKitBuild\Debug\WTF\Headers\wtf\Ref.h @ 62]
0c 000000df`99cfdaa0 00007fff`62c2502f WebKit!<lambda_4e22691d599e3c2bc2e871e79055c6a5>::~<lambda_4e22691d599e3c2bc2e871e79055c6a5>(void)+0x40
0d 000000df`99cfdad0 00007fff`62c3e30c WebKit!WTF::Detail::CallableWrapper<<lambda_4e22691d599e3c2bc2e871e79055c6a5>,void>::~CallableWrapper<<lambda_4e22691d599e3c2bc2e871e79055c6a5>,void>(void)+0x2f
0e 000000df`99cfdb00 00007fff`60309d33 WebKit!WTF::Detail::CallableWrapper<<lambda_4e22691d599e3c2bc2e871e79055c6a5>,void>::`scalar deleting destructor'(void)+0x2c
0f 000000df`99cfdb30 00007fff`60301ed7 WebKit!std::default_delete<WTF::Detail::CallableWrapperBase<void> >::operator()(class WTF::Detail::CallableWrapperBase<void> * _Ptr = 0x00000213`dc5c5a40)+0x53 [C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\include\memory @ 2537]
10 000000df`99cfdb80 00007fff`602fe7eb WebKit!std::unique_ptr<WTF::Detail::CallableWrapperBase<void>,std::default_delete<WTF::Detail::CallableWrapperBase<void> > >::~unique_ptr<WTF::Detail::CallableWrapperBase<void>,std::default_delete<WTF::Detail::CallableWrapperBase<void> > >(void)+0x57 [C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\include\memory @ 2649]
11 000000df`99cfdbc0 00007fff`62cdc01f WebKit!WTF::Function<void __cdecl(void)+0x2b
12 000000df`99cfdbf0 00007fff`62cddadc WebKit!WebCore::EventLoopFunctionDispatchTask::~EventLoopFunctionDispatchTask(void)+0x2f
13 000000df`99cfdc20 00007fff`6261a773 WebKit!WebCore::EventLoopFunctionDispatchTask::`scalar deleting destructor'(void)+0x2c
14 000000df`99cfdc50 00007fff`62618997 WebKit!std::default_delete<WebCore::EventLoopTask>::operator()(class WebCore::EventLoopTask * _Ptr = 0x00000213`dc5c52f0)+0x53 [C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\include\memory @ 2537]
15 000000df`99cfdca0 00007fff`6261aa4c WebKit!std::unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask> >::~unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask> >(void)+0x57 [C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\include\memory @ 2649]
16 000000df`99cfdce0 00007fff`6261b465 WebKit!std::unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask> >::`scalar deleting destructor'(void)+0x2c
17 000000df`99cfdd10 00007fff`6261b4a2 WebKit!WTF::VectorDestructor<1,std::unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask> > >::destruct(class std::unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask> > * begin = 0x00000213`df3146a0 unique_ptr {...}, class std::unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask> > * end = 0x00000213`df3146b0 empty)+0x55 [C:\home\webkit\gc\WebKitBuild\Debug\WTF\Headers\wtf\Vector.h @ 67]
18 000000df`99cfdd50 00007fff`62618556 WebKit!WTF::VectorTypeOperations<std::unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask> > >::destruct(class std::unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask> > * begin = 0x00000213`df3146a0 unique_ptr {...}, class std::unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask> > * end = 0x00000213`df3146b0 empty)+0x32 [C:\home\webkit\gc\WebKitBuild\Debug\WTF\Headers\wtf\Vector.h @ 244]
19 000000df`99cfdd80 00007fff`62ccb568 WebKit!WTF::Vector<std::unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask> >,0,WTF::CrashOnOverflow,16,WTF::FastMalloc>::~Vector<std::unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask> >,0,WTF::CrashOnOverflow,16,WTF::FastMalloc>(void)+0x56 [C:\home\webkit\gc\WebKitBuild\Debug\WTF\Headers\wtf\Vector.h @ 678]
1a 000000df`99cfddc0 00007fff`62e3f106 WebKit!WebCore::EventLoop::run(void)+0x2f8 [C:\home\webkit\gc\Source\WebCore\dom\EventLoop.cpp @ 133]
1b 000000df`99cfdf20 00007fff`62e4b93e WebKit!WebCore::WindowEventLoop::didReachTimeToRun(void)+0x46 [C:\home\webkit\gc\Source\WebCore\dom\WindowEventLoop.cpp @ 121]
1c 000000df`99cfdf80 00007fff`62e469f2 WebKit!std::invoke<void (<function> ** _Obj = 0x00000213`dc3f7fe8, class WebCore::WindowEventLoop ** _Arg1 = 0x00000213`dc3f7ff8)+0x4e [C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\include\type_traits @ 1614]
1d 000000df`99cfdfc0 00007fff`62e46a65 WebKit!std::_Invoker_ret<std::_Unforced,0>::_Call<void (<function> ** _Func = 0x00000213`dc3f7fe8, class WebCore::WindowEventLoop ** <_Vals_0> = 0x00000213`dc3f7ff8)+0x32 [C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\include\functional @ 773]
1e 000000df`99cfdff0 00007fff`62e4691f WebKit!std::_Call_binder<std::_Unforced,0,void (struct std::_Invoker_ret<std::_Unforced,0> __formal = struct std::_Invoker_ret<std::_Unforced,0>, struct std::integer_sequence<unsigned __int64,0> __formal = struct std::integer_sequence<unsigned __int64,0>, <function> ** _Obj = 0x00000213`dc3f7fe8, class std::tuple<WebCore::WindowEventLoop *> * _Tpl = 0x00000213`dc3f7ff8 {...}, class std::tuple<> * _Ut = 0x000000df`99cfe060)+0x65 [C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\include\functional @ 1440]
1f 000000df`99cfe030 00007fff`62e56a6f WebKit!std::_Binder<std::_Unforced,void (void)+0xaf [C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333\include\functional @ 1496]
20 000000df`99cfe090 00007fff`60320818 WebKit!WTF::Detail::CallableWrapper<std::_Binder<std::_Unforced,void (void)+0x2f [C:\home\webkit\gc\WebKitBuild\Debug\WTF\Headers\wtf\Function.h @ 52]
21 000000df`99cfe0c0 00007fff`6032146f WebKit!WTF::Function<void __cdecl(void)+0xa8 [C:\home\webkit\gc\WebKitBuild\Debug\WTF\Headers\wtf\Function.h @ 84]
22 000000df`99cfe100 00007fff`63be586e WebKit!WebCore::Timer::fired(void)+0x2f [C:\home\webkit\gc\WebKitBuild\Debug\WebCore\PrivateHeaders\WebCore\Timer.h @ 137]
23 000000df`99cfe130 00007fff`63bf16b3 WebKit!WebCore::ThreadTimers::sharedTimerFiredInternal(void)+0x2fe [C:\home\webkit\gc\Source\WebCore\platform\ThreadTimers.cpp @ 130]
24 000000df`99cfe230 00007fff`63bf29ff WebKit!<lambda_262b710db5e1fd9cbe42ca9bc65314e1>::operator()(void)+0x33 [C:\home\webkit\gc\Source\WebCore\platform\ThreadTimers.cpp @ 67]
25 000000df`99cfe260 00007fff`60320818 WebKit!WTF::Detail::CallableWrapper<<lambda_262b710db5e1fd9cbe42ca9bc65314e1>,void>::call(void)+0x2f [C:\home\webkit\gc\WebKitBuild\Debug\WTF\Headers\wtf\Function.h @ 52]
26 000000df`99cfe290 00007fff`63ba98bb WebKit!WTF::Function<void __cdecl(void)+0xa8 [C:\home\webkit\gc\WebKitBuild\Debug\WTF\Headers\wtf\Function.h @ 84]
27 000000df`99cfe2d0 00007fff`608d92de WebKit!WebCore::MainThreadSharedTimer::fired(void)+0x9b [C:\home\webkit\gc\Source\WebCore\platform\MainThreadSharedTimer.cpp @ 84]
28 000000df`99cfe300 00007fff`d55d5c1d WebKit!WebCore::TimerWindowWndProc(struct HWND__ * hWnd = 0x00000000`005c1104, unsigned int message = 0xc258, unsigned int64 wParam = 0, int64 lParam = 0n0)+0xbe [C:\home\webkit\gc\Source\WebCore\platform\win\MainThreadSharedTimerWin.cpp @ 89]
29 000000df`99cfe330 00007fff`d55d5612 USER32!UserCallWinProcCheckWow+0x2bd
2a 000000df`99cfe4c0 00007fff`8a969ad1 USER32!DispatchMessageWorker+0x1e2
2b 000000df`99cfe540 00007fff`8a96acb8 DumpRenderTreeLib!runTest(class std::basic_string<char,std::char_traits<char>,std::allocator<char> > * inputLine = 0x000000df`99cff5b0 "http://127.0.0.1:8000/websocket/construct-in-detached-frame.html'--absolutePath'C:\home\webkit\gc\LayoutTests\http\tests\websocket\construct-in-detached-frame.html'--timeout'30000")+0xbd1 [C:\home\webkit\gc\Tools\DumpRenderTree\win\DumpRenderTree.cpp @ 1306]
2c 000000df`99cfec50 00007fff`8a96aedf DumpRenderTreeLib!main(int argc = 0n2, char ** argv = 0x00000213`9864bab0)+0x748 [C:\home\webkit\gc\Tools\DumpRenderTree\win\DumpRenderTree.cpp @ 1663]
2d 000000df`99cff6d0 00007ff7`c5531a0a DumpRenderTreeLib!dllLauncherEntryPoint(int argc = 0n2, char ** argv = 0x00000213`9864bab0)+0x2f [C:\home\webkit\gc\Tools\DumpRenderTree\win\DumpRenderTree.cpp @ 1704]
2e 000000df`99cff700 00007ff7`c5535738 DumpRenderTree!main(int argc = 0n2, char ** argv = 0x00000213`9864bab0)+0x4aa [C:\home\webkit\gc\Tools\win\DLLLauncher\DLLLauncherMain.cpp @ 222]
2f (Inline Function) --------`-------- DumpRenderTree!invoke_main(void)+0x22 [d:\agent\_work\63\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 78]
30 000000df`99cffc00 00007fff`d5997c24 DumpRenderTree!__scrt_common_main_seh(void)+0x10c [d:\agent\_work\63\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 288]
31 000000df`99cffc40 00007fff`d6d4d4d1 KERNEL32!BaseThreadInitThunk+0x14
32 000000df`99cffc70 00000000`00000000 ntdll!RtlUserThreadStart+0x21
Comment 2 Fujii Hironori 2021-01-07 21:32:09 PST
This assertion failure can be reproduced by invoking DumpRenderTree.exe manually.

1. Start httpd
  1. Open PowerShell as Administrator
  2. python .\Tools\Scripts\run-webkit-httpd --no-wpt
2. .\WebKitBuild\Debug\bin64\DumpRenderTree.exe -
3. Input "http://127.0.0.1:8000/websocket/construct-in-detached-frame.html" into the console
4. Input "http://127.0.0.1:8000/" into the console
Comment 3 Fujii Hironori 2021-01-07 21:41:00 PST
This is a bug specific to WebKit1.
WebKitTestRunner.exe can't reproduce it.
In WebKitTestRunner.exe, WebSocket::stop() is called before WebSocket::contextDestroyed() is called.
In DumpRenderTree.exe , WebSocket::contextDestroyed() is called immediately after loading a new page.
Comment 4 Fujii Hironori 2021-01-07 21:41:12 PST
WebKitTestRunner.exe's callstack of WebSocket::stop()

> WebKit2.dll!WebCore::WebSocket::stop() Line 559	C++
> WebKit2.dll!<lambda_500c889ab36e67147b26d124d5097ef2>::operator()<WebCore::ScriptExecutionContext>(WebCore::ScriptExecutionContext & __formal) Line 225	C++
> WebKit2.dll!WTF::Detail::CallableWrapper<<lambda_500c889ab36e67147b26d124d5097ef2>,void,WebCore::ScriptExecutionContext &>::call(WebCore::ScriptExecutionContext & <in_0>) Line 52	C++
> WebKit2.dll!WTF::Function<void __cdecl(WebCore::ScriptExecutionContext &)>::operator()(WebCore::ScriptExecutionContext & <in_0>) Line 84	C++
> WebKit2.dll!WebCore::ScriptExecutionContext::Task::performTask(WebCore::ScriptExecutionContext & context) Line 191	C++
> WebKit2.dll!WebCore::Document::postTask::__l2::<lambda>() Line 6380	C++
> WebKit2.dll!WTF::Detail::CallableWrapper<void <lambda>(void),void>::call() Line 52	C++
> WTF.dll!WTF::Function<void __cdecl(void)>::operator()() Line 84	C++
> WTF.dll!WTF::RunLoop::performWork() Line 129	C++
> WTF.dll!WTF::RunLoop::wndProc(HWND__ * hWnd, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 57	C++
> WTF.dll!WTF::RunLoop::RunLoopWndProc(HWND__ * hWnd, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 39	C++
> user32.dll!00007fffd55d5c1d()	Unknown
> user32.dll!00007fffd55d5612()	Unknown
> WTF.dll!WTF::RunLoop::run() Line 74	C++
> WebKit2.dll!WebKit::AuxiliaryProcessMain<WebKit::WebProcess,WebKit::WebProcessMainWin>(int argc, char * * argv) Line 69	C++
> WebKit2.dll!WebKit::WebProcessMain(int argc, char * * argv) Line 58	C++
> WebKitWebProcess.exe!main(int argc, char * * argv) Line 35	C++
> [Inline Frame] WebKitWebProcess.exe!invoke_main() Line 78	C++
> WebKitWebProcess.exe!__scrt_common_main_seh() Line 288	C++
> kernel32.dll!00007fffd5997c24()	Unknown
> ntdll.dll!00007fffd6d4d4d1()	Unknown

WebKitTestRunner.exe's callstack of WebSocket::contextDestroyed()

> WebKit2.dll!WebCore::WebSocket::contextDestroyed() Line 509	C++
> WebKit2.dll!WebCore::ScriptExecutionContext::~ScriptExecutionContext() Line 175	C++
> WebKit2.dll!WebCore::Document::~Document() Line 724	C++
> WebKit2.dll!WebCore::HTMLDocument::~HTMLDocument() Line 99	C++
> WebKit2.dll!WebCore::HTMLDocument::`scalar deleting destructor'(unsigned int)	C++
> WebKit2.dll!WebCore::Document::decrementReferencingNodeCount() Line 375	C++
> WebKit2.dll!WebCore::Document::removedLastRef() Line 777	C++
> WebKit2.dll!WebCore::Node::removedLastRef() Line 2551	C++
> WebKit2.dll!WebCore::Node::deref() Line 801	C++
> WebKit2.dll!WebCore::Node::derefEventTarget() Line 843	C++
> WebKit2.dll!WebCore::EventTarget::deref() Line 60	C++
> WebKit2.dll!WTF::Ref<WebCore::EventTarget,WTF::RawPtrTraits<WebCore::EventTarget>>::~Ref<WebCore::EventTarget,WTF::RawPtrTraits<WebCore::EventTarget>>() Line 62	C++
> WebKit2.dll!WebCore::JSDOMWrapper<WebCore::EventTarget>::~JSDOMWrapper<WebCore::EventTarget>()	C++
> WebKit2.dll!WebCore::JSEventTarget::~JSEventTarget()	C++
> WebKit2.dll!WebCore::JSEventTarget::destroy(JSC::JSCell * cell) Line 265	C++
> JavaScriptCore.dll!JSC::JSDestructibleObjectDestroyFunc::operator()(JSC::VM & __formal, JSC::JSCell * cell) Line 39	C++
> JavaScriptCore.dll!JSC::JSDestructibleObjectHeapCellType::destroy(JSC::VM & vm, JSC::JSCell * cell) Line 59	C++
> JavaScriptCore.dll!JSC::Subspace::destroy(JSC::VM & vm, JSC::JSCell * cell) Line 66	C++
> JavaScriptCore.dll!JSC::PreciseAllocation::sweep() Line 252	C++
> JavaScriptCore.dll!JSC::MarkedSpace::sweepPreciseAllocations() Line 235	C++
> JavaScriptCore.dll!JSC::Heap::sweepInFinalize() Line 2156	C++
> JavaScriptCore.dll!JSC::Heap::finalize() Line 2096	C++
> JavaScriptCore.dll!JSC::Heap::handleNeedFinalize(unsigned int oldState) Line 2019	C++
> JavaScriptCore.dll!JSC::Heap::handleNeedFinalize() Line 2032	C++
> JavaScriptCore.dll!JSC::Heap::finishChangingPhase(JSC::GCConductor conn) Line 1604	C++
> JavaScriptCore.dll!JSC::Heap::changePhase(JSC::GCConductor conn, JSC::CollectorPhase nextPhase) Line 1578	C++
> JavaScriptCore.dll!JSC::Heap::runEndPhase(JSC::GCConductor conn) Line 1568	C++
> JavaScriptCore.dll!JSC::Heap::runCurrentPhase(JSC::GCConductor conn, JSC::CurrentThreadState * currentThreadState) Line 1227	C++
> JavaScriptCore.dll!JSC::Heap::collectInMutatorThread::__l6::<lambda>(JSC::CurrentThreadState & state) Line 1842	C++
> JavaScriptCore.dll!WTF::ScopedLambdaFunctor<void __cdecl(JSC::CurrentThreadState &),void <lambda>(JSC::CurrentThreadState &)>::implFunction(void * argument, JSC::CurrentThreadState & <arguments_0>) Line 107	C++
> JavaScriptCore.dll!WTF::ScopedLambda<void __cdecl(JSC::CurrentThreadState &)>::operator()<JSC::CurrentThreadState &>(JSC::CurrentThreadState & <arguments_0>) Line 59	C++
> JavaScriptCore.dll!JSC::callWithCurrentThreadState(const WTF::ScopedLambda<void __cdecl(JSC::CurrentThreadState &)> & lambda) Line 222	C++
> JavaScriptCore.dll!JSC::Heap::collectInMutatorThread() Line 1855	C++
> JavaScriptCore.dll!JSC::Heap::stopIfNecessarySlow(unsigned int oldState) Line 1825	C++
> JavaScriptCore.dll!JSC::Heap::stopIfNecessarySlow() Line 1794	C++
> JavaScriptCore.dll!JSC::Heap::stopIfNecessary() Line 270	C++
> JavaScriptCore.dll!JSC::Heap::collectIfNecessaryOrDefer(JSC::GCDeferralContext * deferralContext) Line 2633	C++
> JavaScriptCore.dll!JSC::Heap::decrementDeferralDepthAndGCIfNeededSlow() Line 2670	C++
> JavaScriptCore.dll!JSC::Heap::decrementDeferralDepthAndGCIfNeeded() Line 215	C++
> JavaScriptCore.dll!JSC::DeferGC::~DeferGC() Line 50	C++
> JavaScriptCore.dll!JSC::GCSafeConcurrentJSLocker::~GCSafeConcurrentJSLocker() Line 91	C++
> JavaScriptCore.dll!JSC::Structure::add<1,void <lambda>(const JSC::GCSafeConcurrentJSLocker &, int, int)>(JSC::VM & vm, JSC::PropertyName propertyName, unsigned int attributes, const JSC::JSObject::prepareToPutDirectWithoutTransition::__l2::void <lambda>(const JSC::GCSafeConcurrentJSLocker &, int, int) & func) Line 486	C++
> JavaScriptCore.dll!JSC::Structure::addPropertyWithoutTransition<void <lambda>(const JSC::GCSafeConcurrentJSLocker &, int, int)>(JSC::VM & vm, JSC::PropertyName propertyName, unsigned int attributes, const JSC::JSObject::prepareToPutDirectWithoutTransition::__l2::void <lambda>(const JSC::GCSafeConcurrentJSLocker &, int, int) & func) Line 579	C++
> JavaScriptCore.dll!JSC::JSObject::prepareToPutDirectWithoutTransition(JSC::VM & vm, JSC::PropertyName propertyName, unsigned int attributes, unsigned int structureID, JSC::Structure * structure) Line 248	C++
> JavaScriptCore.dll!JSC::JSObject::putDirectWithoutTransition(JSC::VM & vm, JSC::PropertyName propertyName, JSC::JSValue value, unsigned int attributes) Line 220	C++
> JavaScriptCore.dll!JSC::JSObject::putDirectNativeFunctionWithoutTransition(JSC::VM & vm, JSC::JSGlobalObject * globalObject, const JSC::PropertyName & propertyName, unsigned int functionLength, JSC::NativeFunction nativeFunction, JSC::Intrinsic intrinsic, unsigned int attributes) Line 3289	C++
> JavaScriptCore.dll!JSC::StringPrototype::finishCreation(JSC::VM & vm, JSC::JSGlobalObject * globalObject, JSC::JSString * nameAndMessage) Line 145	C++
> JavaScriptCore.dll!JSC::StringPrototype::create(JSC::VM & vm, JSC::JSGlobalObject * globalObject, JSC::Structure * structure) Line 176	C++
> JavaScriptCore.dll!JSC::JSGlobalObject::init(JSC::VM & vm) Line 867	C++
> JavaScriptCore.dll!JSC::JSGlobalObject::finishCreation(JSC::VM & vm, JSC::JSObject * thisValue) Line 2372	C++
> WebKit2.dll!WebCore::JSDOMGlobalObject::finishCreation(JSC::VM & vm, JSC::JSObject * thisValue) Line 212	C++
> WebKit2.dll!WebCore::JSDOMWindowBase::finishCreation(JSC::VM & vm, WebCore::JSWindowProxy * proxy) Line 107	C++
> WebKit2.dll!WebCore::JSDOMWindow::finishCreation(JSC::VM & vm, WebCore::JSWindowProxy * proxy) Line 6476	C++
> WebKit2.dll!WebCore::JSDOMWindow::create(JSC::VM & vm, JSC::Structure * structure, WTF::Ref<WebCore::DOMWindow,WTF::RawPtrTraits<WebCore::DOMWindow>> && impl, WebCore::JSWindowProxy * proxy) Line 42	C++
> WebKit2.dll!WebCore::JSWindowProxy::setWindow(WebCore::AbstractDOMWindow & domWindow) Line 107	C++
> WebKit2.dll!WebCore::WindowProxy::setDOMWindow(WebCore::AbstractDOMWindow * newDOMWindow) Line 175	C++
> WebKit2.dll!WebCore::FrameLoader::clear(WebCore::Document * newDocument, bool clearWindowProperties, bool clearScriptObjects, bool clearFrameView, WTF::Function<void __cdecl(void)> && handleDOMWindowCreation) Line 678	C++
> WebKit2.dll!WebCore::DocumentWriter::begin(const WTF::URL & urlReference, bool dispatch, WebCore::Document * ownerDocument) Line 156	C++
> WebKit2.dll!WebCore::DocumentLoader::commitData(const char * bytes, unsigned __int64 length) Line 1139	C++
> WebKit2.dll!WebKit::WebFrameLoaderClient::committedLoad(WebCore::DocumentLoader * loader, const char * data, int length) Line 1150	C++
> WebKit2.dll!WebCore::DocumentLoader::commitLoad(const char * data, int length) Line 1111	C++
> WebKit2.dll!WebCore::DocumentLoader::dataReceived(const char * data, int length) Line 1260	C++
> WebKit2.dll!WebCore::DocumentLoader::dataReceived(WebCore::CachedResource & resource, const char * data, int length) Line 1233	C++
> WebKit2.dll!WebCore::CachedRawResource::notifyClientsDataWasReceived(const char * data, unsigned int length) Line 139	C++
> WebKit2.dll!WebCore::CachedRawResource::updateBuffer(WebCore::SharedBuffer & data) Line 77	C++
> WebKit2.dll!WebCore::SubresourceLoader::didReceiveDataOrBuffer(const char * data, int length, WTF::RefPtr<WebCore::SharedBuffer,WTF::RawPtrTraits<WebCore::SharedBuffer>,WTF::DefaultRefDerefTraits<WebCore::SharedBuffer>> && buffer, __int64 encodedDataLength, WebCore::DataPayloadType dataPayloadType) Line 537	C++
> WebKit2.dll!WebCore::SubresourceLoader::didReceiveData(const char * data, unsigned int length, __int64 encodedDataLength, WebCore::DataPayloadType dataPayloadType) Line 505	C++
> WebKit2.dll!WebKit::WebResourceLoader::didReceiveData(const IPC::ArrayReference<unsigned char,-1> & data, __int64 encodedDataLength) Line 211	C++
> WebKit2.dll!IPC::callMemberFunctionImpl<WebKit::WebResourceLoader,void (__cdecl WebKit::WebResourceLoader::*)(IPC::ArrayReference<unsigned char,-1> const &,__int64),std::tuple<IPC::ArrayReference<unsigned char,-1>,__int64>,0,1>(WebKit::WebResourceLoader * object, void(WebKit::WebResourceLoader::*)(const IPC::ArrayReference<unsigned char,-1> &, __int64) function, std::tuple<IPC::ArrayReference<unsigned char,-1>,__int64> && args, std::integer_sequence<unsigned __int64,0,1> __formal) Line 43	C++
> WebKit2.dll!IPC::callMemberFunction<WebKit::WebResourceLoader,void (__cdecl WebKit::WebResourceLoader::*)(IPC::ArrayReference<unsigned char,-1> const &,__int64),std::tuple<IPC::ArrayReference<unsigned char,-1>,__int64>,std::integer_sequence<unsigned __int64,0,1>>(std::tuple<IPC::ArrayReference<unsigned char,-1>,__int64> && args, WebKit::WebResourceLoader * object, void(WebKit::WebResourceLoader::*)(const IPC::ArrayReference<unsigned char,-1> &, __int64) function) Line 49	C++
> WebKit2.dll!IPC::handleMessage<Messages::WebResourceLoader::DidReceiveData,WebKit::WebResourceLoader,void (__cdecl WebKit::WebResourceLoader::*)(IPC::ArrayReference<unsigned char,-1> const &,__int64)>(IPC::Decoder & decoder, WebKit::WebResourceLoader * object, void(WebKit::WebResourceLoader::*)(const IPC::ArrayReference<unsigned char,-1> &, __int64) function) Line 121	C++
> WebKit2.dll!WebKit::WebResourceLoader::didReceiveWebResourceLoaderMessage(IPC::Connection & connection, IPC::Decoder & decoder) Line 62	C++
> WebKit2.dll!WebKit::NetworkProcessConnection::didReceiveMessage(IPC::Connection & connection, IPC::Decoder & decoder) Line 94	C++
> WebKit2.dll!IPC::Connection::dispatchMessage(IPC::Decoder & decoder) Line 1040	C++
> WebKit2.dll!IPC::Connection::dispatchMessage(std::unique_ptr<IPC::Decoder,std::default_delete<IPC::Decoder>> message) Line 1141	C++
> WebKit2.dll!IPC::Connection::dispatchOneIncomingMessage() Line 1209	C++
> WebKit2.dll!IPC::Connection::enqueueIncomingMessage::__l2::<lambda>() Line 1003	C++
> WebKit2.dll!WTF::Detail::CallableWrapper<void <lambda>(void),void>::call() Line 52	C++
> WTF.dll!WTF::Function<void __cdecl(void)>::operator()() Line 84	C++
> WTF.dll!WTF::RunLoop::performWork() Line 129	C++
> WTF.dll!WTF::RunLoop::wndProc(HWND__ * hWnd, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 57	C++
> WTF.dll!WTF::RunLoop::RunLoopWndProc(HWND__ * hWnd, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 39	C++
> user32.dll!00007fffd55d5c1d()	Unknown
> user32.dll!00007fffd55d5612()	Unknown
> WTF.dll!WTF::RunLoop::run() Line 74	C++
> WebKit2.dll!WebKit::AuxiliaryProcessMain<WebKit::WebProcess,WebKit::WebProcessMainWin>(int argc, char * * argv) Line 69	C++
> WebKit2.dll!WebKit::WebProcessMain(int argc, char * * argv) Line 58	C++
> WebKitWebProcess.exe!main(int argc, char * * argv) Line 35	C++
> [Inline Frame] WebKitWebProcess.exe!invoke_main() Line 78	C++
> WebKitWebProcess.exe!__scrt_common_main_seh() Line 288	C++
> kernel32.dll!00007fffd5997c24()	Unknown
> ntdll.dll!00007fffd6d4d4d1()	Unknown
Comment 5 Fujii Hironori 2021-01-07 21:41:21 PST
DumpRenderTree.exe's callstack of WebSocket::contextDestroyed()

> WebKit.dll!WebCore::WebSocket::contextDestroyed() Line 509	C++
> WebKit.dll!WebCore::ScriptExecutionContext::~ScriptExecutionContext() Line 175	C++
> WebKit.dll!WebCore::Document::~Document() Line 724	C++
> WebKit.dll!WebCore::HTMLDocument::~HTMLDocument() Line 99	C++
> WebKit.dll!WebCore::HTMLDocument::`scalar deleting destructor'(unsigned int)	C++
> WebKit.dll!WebCore::Document::decrementReferencingNodeCount() Line 375	C++
> WebKit.dll!WebCore::Document::removedLastRef() Line 777	C++
> WebKit.dll!WebCore::Node::removedLastRef() Line 2551	C++
> WebKit.dll!WebCore::Node::deref() Line 801	C++
> WebKit.dll!WTF::Ref<WebCore::Document,WTF::RawPtrTraits<WebCore::Document>>::~Ref<WebCore::Document,WTF::RawPtrTraits<WebCore::Document>>() Line 62	C++
> WebKit.dll!void <lambda>(void)::~void <lambda>(void)()	C++
> WebKit.dll!WTF::Detail::CallableWrapper<void <lambda>(void),void>::~CallableWrapper<void <lambda>(void),void>()	C++
> WebKit.dll!WTF::Detail::CallableWrapper<void <lambda>(void),void>::`scalar deleting destructor'(unsigned int)	C++
> WebKit.dll!std::default_delete<WTF::Detail::CallableWrapperBase<void>>::operator()(WTF::Detail::CallableWrapperBase<void> * _Ptr) Line 2537	C++
> WebKit.dll!std::unique_ptr<WTF::Detail::CallableWrapperBase<void>,std::default_delete<WTF::Detail::CallableWrapperBase<void>>>::~unique_ptr<WTF::Detail::CallableWrapperBase<void>,std::default_delete<WTF::Detail::CallableWrapperBase<void>>>() Line 2649	C++
> WebKit.dll!WTF::Function<void __cdecl(void)>::~Function<void __cdecl(void)>()	C++
> WebKit.dll!WebCore::EventLoopFunctionDispatchTask::~EventLoopFunctionDispatchTask()	C++
> WebKit.dll!WebCore::EventLoopFunctionDispatchTask::`scalar deleting destructor'(unsigned int)	C++
> WebKit.dll!std::default_delete<WebCore::EventLoopTask>::operator()(WebCore::EventLoopTask * _Ptr) Line 2537	C++
> WebKit.dll!std::unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask>>::~unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask>>() Line 2649	C++
> WebKit.dll!std::unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask>>::`scalar deleting destructor'(unsigned int)	C++
> WebKit.dll!WTF::VectorDestructor<1,std::unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask>>>::destruct(std::unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask>> * begin, std::unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask>> * end) Line 67	C++
> WebKit.dll!WTF::VectorTypeOperations<std::unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask>>>::destruct(std::unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask>> * begin, std::unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask>> * end) Line 244	C++
> WebKit.dll!WTF::Vector<std::unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask>>,0,WTF::CrashOnOverflow,16,WTF::FastMalloc>::~Vector<std::unique_ptr<WebCore::EventLoopTask,std::default_delete<WebCore::EventLoopTask>>,0,WTF::CrashOnOverflow,16,WTF::FastMalloc>() Line 678	C++
> WebKit.dll!WebCore::EventLoop::run() Line 133	C++
> WebKit.dll!WebCore::WindowEventLoop::didReachTimeToRun() Line 121	C++
> WebKit.dll!std::invoke<void (__cdecl WebCore::WindowEventLoop::*&)(void),WebCore::WindowEventLoop * &>(void(WebCore::WindowEventLoop::*)() & _Obj, WebCore::WindowEventLoop * & _Arg1) Line 1614	C++
> WebKit.dll!std::_Invoker_ret<std::_Unforced,0>::_Call<void (__cdecl WebCore::WindowEventLoop::*&)(void),WebCore::WindowEventLoop * &>(void(WebCore::WindowEventLoop::*)() & _Func, WebCore::WindowEventLoop * & <_Vals_0>) Line 773	C++
> WebKit.dll!std::_Call_binder<std::_Unforced,0,void (__cdecl WebCore::WindowEventLoop::*)(void),std::tuple<WebCore::WindowEventLoop *>,std::tuple<>>(std::_Invoker_ret<std::_Unforced,0> __formal, std::integer_sequence<unsigned __int64,0> __formal, void(WebCore::WindowEventLoop::*)() & _Obj, std::tuple<WebCore::WindowEventLoop *> & _Tpl, std::tuple<> && _Ut) Line 1440	C++
> WebKit.dll!std::_Binder<std::_Unforced,void (__cdecl WebCore::WindowEventLoop::*&)(void),WebCore::WindowEventLoop *>::operator()<>() Line 1496	C++
> WebKit.dll!WTF::Detail::CallableWrapper<std::_Binder<std::_Unforced,void (__cdecl WebCore::WindowEventLoop::*&)(void),WebCore::WindowEventLoop *>,void>::call() Line 52	C++
> WebKit.dll!WTF::Function<void __cdecl(void)>::operator()() Line 84	C++
> WebKit.dll!WebCore::Timer::fired() Line 137	C++
> WebKit.dll!WebCore::ThreadTimers::sharedTimerFiredInternal() Line 130	C++
> WebKit.dll!WebCore::ThreadTimers::setSharedTimer::__l8::<lambda>() Line 67	C++
> WebKit.dll!WTF::Detail::CallableWrapper<void <lambda>(void),void>::call() Line 52	C++
> WebKit.dll!WTF::Function<void __cdecl(void)>::operator()() Line 84	C++
> WebKit.dll!WebCore::MainThreadSharedTimer::fired() Line 84	C++
> WebKit.dll!WebCore::TimerWindowWndProc(HWND__ * hWnd, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 89	C++
> user32.dll!00007fffd55d5c1d()	Unknown
> user32.dll!00007fffd55d5612()	Unknown
> DumpRenderTreeLib.dll!runTest(const std::string & inputLine) Line 1306	C++
> DumpRenderTreeLib.dll!main(int argc, const char * * argv) Line 1663	C++
> DumpRenderTreeLib.dll!dllLauncherEntryPoint(int argc, const char * * argv) Line 1704	C++
> DumpRenderTree.exe!main(int argc, const char * * argv) Line 222	C++
> [Inline Frame] DumpRenderTree.exe!invoke_main() Line 78	C++
> DumpRenderTree.exe!__scrt_common_main_seh() Line 288	C++
> kernel32.dll!00007fffd5997c24()	Unknown
> ntdll.dll!00007fffd6d4d4d1()	Unknown
Comment 6 Fujii Hironori 2021-01-07 23:34:09 PST
WebSocket::failAsynchronously() dispatched a deferred task
calling WebSocket::stop(), but the task was not executed because
DumpRenderTree stopped running the run loop after finishing the test.
Comment 7 Fujii Hironori 2021-01-07 23:34:22 PST
Created attachment 417247 [details]
WIP patch
Comment 8 Fujii Hironori 2021-01-11 12:10:07 PST
Created attachment 417399 [details]
Patch
Comment 9 Fujii Hironori 2021-01-11 12:18:59 PST
r213270 seems the culprit.
Bug 169026 – [Win] DRT should not dispatch messages after test is done.
Comment 10 Fujii Hironori 2021-01-11 22:22:16 PST
Created attachment 417434 [details]
Patch
Comment 11 Per Arne Vollan 2021-01-12 04:12:32 PST
(In reply to Fujii Hironori from comment #9)
> r213270 seems the culprit.
> Bug 169026 – [Win] DRT should not dispatch messages after test is done.

I think we need to stop dispatching messages after the test is done to avoid flakiness and test failures. Is there another way you can fix the assert?
Comment 12 Per Arne Vollan 2021-01-12 04:15:07 PST
(In reply to Per Arne Vollan from comment #11)
> (In reply to Fujii Hironori from comment #9)
> > r213270 seems the culprit.
> > Bug 169026 – [Win] DRT should not dispatch messages after test is done.
> 
> I think we need to stop dispatching messages after the test is done to avoid
> flakiness and test failures. Is there another way you can fix the assert?

Also, is the assert correct? Perhaps we need to allow this case, and handle it gracefully.
Comment 13 Per Arne Vollan 2021-01-12 10:02:47 PST
Looking at the AppleWin test results, the test fast/events/currentTarget-gc-crash.html seems to be failing, and some other fast/events tests are flaky.
Comment 14 Fujii Hironori 2021-01-12 17:56:50 PST
(In reply to Per Arne Vollan from comment #11)
> I think we need to stop dispatching messages after the test is done to avoid
> flakiness and test failures. Is there another way you can fix the assert?

Windows WTR doesn't stop the main run loop after each test.
I think we should debug the flaky tests.

(In reply to Per Arne Vollan from comment #12)
> Also, is the assert correct? Perhaps we need to allow this case, and handle
> it gracefully.

I'm guessing timer events can execute out of order.
callOnMainThread is using WTF::RunLoop::Timer, while WebSocket::contextDestroyed() is executed by WebCore::Timer.
RunLoop::Timer and WebCore::Timer have own task queues and own windows.
But, I'm not certain.

(In reply to Per Arne Vollan from comment #13)
> Looking at the AppleWin test results, the test
> fast/events/currentTarget-gc-crash.html seems to be failing, and some other
> fast/events tests are flaky.

fast/events/currentTarget-gc-crash.html
svg/custom/animate-initial-pause-unpause.html
seem the regressions of my patch.
Other failures seem existing unmarked flaky tests.
Comment 15 Fujii Hironori 2021-01-12 23:05:40 PST
fast/events/currentTarget-gc-crash.html timeout seems another issue.
Filed: Bug 220579 – [Win][WK1] fast/events/currentTarget-gc-crash.html makes UI unresponsive
Comment 16 Per Arne Vollan 2021-01-13 08:57:07 PST
(In reply to Fujii Hironori from comment #14)
> (In reply to Per Arne Vollan from comment #11)
> > I think we need to stop dispatching messages after the test is done to avoid
> > flakiness and test failures. Is there another way you can fix the assert?
> 
> Windows WTR doesn't stop the main run loop after each test.

IIRC, Mac also stops the run loop.

> I think we should debug the flaky tests.
> 
> (In reply to Per Arne Vollan from comment #12)
> > Also, is the assert correct? Perhaps we need to allow this case, and handle
> > it gracefully.
> 
> I'm guessing timer events can execute out of order.
> callOnMainThread is using WTF::RunLoop::Timer, while
> WebSocket::contextDestroyed() is executed by WebCore::Timer.
> RunLoop::Timer and WebCore::Timer have own task queues and own windows.
> But, I'm not certain.
> 
> (In reply to Per Arne Vollan from comment #13)
> > Looking at the AppleWin test results, the test
> > fast/events/currentTarget-gc-crash.html seems to be failing, and some other
> > fast/events tests are flaky.
> 
> fast/events/currentTarget-gc-crash.html
> svg/custom/animate-initial-pause-unpause.html
> seem the regressions of my patch.
> Other failures seem existing unmarked flaky tests.

I am not sure the other fast/events tests were flaky, but I could be wrong :)
Comment 17 Fujii Hironori 2021-01-13 16:26:34 PST
(In reply to Per Arne Vollan from comment #16)
> IIRC, Mac also stops the run loop.

Mac DRT specifies 10 seconds timeout for CFRunLoopRunInMode (r153811).
I can implement the same logic in Windows DRT by using WM_TIMER.
But, I don't like the idea because it hides bugs such like Bug 220579.
I think it's better to mark such tests as Skip or Timeout.

> I am not sure the other fast/events tests were flaky, but I could be wrong :)

Because AppleWin post-commit testing buildbots are broken these days, I have to check the layout test results of EWS run-layout-tests-without-patch.
For example,
https://ews-build.s3-us-west-2.amazonaws.com/Windows-EWS/r417434-72034-clean-tree/results.html
https://ews-build.s3-us-west-2.amazonaws.com/Windows-EWS/r417553-72134-clean-tree/results.html
Comment 18 Fujii Hironori 2021-01-13 22:27:54 PST
Created attachment 417596 [details]
Patch
Comment 19 Fujii Hironori 2021-01-13 22:38:07 PST
Created attachment 417597 [details]
Patch
Comment 20 Per Arne Vollan 2021-01-14 08:27:02 PST
(In reply to Fujii Hironori from comment #17)
> (In reply to Per Arne Vollan from comment #16)
> > IIRC, Mac also stops the run loop.
> 
> Mac DRT specifies 10 seconds timeout for CFRunLoopRunInMode (r153811).
> I can implement the same logic in Windows DRT by using WM_TIMER.
> But, I don't like the idea because it hides bugs such like Bug 220579.
> I think it's better to mark such tests as Skip or Timeout.
> 
> > I am not sure the other fast/events tests were flaky, but I could be wrong :)
> 
> Because AppleWin post-commit testing buildbots are broken these days, I have
> to check the layout test results of EWS run-layout-tests-without-patch.
> For example,
> https://ews-build.s3-us-west-2.amazonaws.com/Windows-EWS/r417434-72034-clean-
> tree/results.html
> https://ews-build.s3-us-west-2.amazonaws.com/Windows-EWS/r417553-72134-clean-
> tree/results.html

Thanks for catching! We should fix this. Ryan, are we currently tracking this?

Do you see a solution where we could fix the assert, avoid introducing a new layout test failure, and be sure that there is no additional flakiness introduced? It is very important that we keep the flakiness at a minimum to make sure the Windows CI system can keep up with the queue and provide continuous test coverage.
Comment 21 Fujii Hironori 2021-01-14 14:05:17 PST
(In reply to Per Arne Vollan from comment #20)
> Do you see a solution where we could fix the assert,

I'm not sure the assert was wrong.
I think Windows DRT should behave same with other DRT and WTR as much as possible.
Only Windows DRT stops the main run loop immediately after done.

> avoid introducing a new
> layout test failure,

I think fast/events/currentTarget-gc-crash.html is a distinct
existing problem which had been hid by Bug 169026's change.

> and be sure that there is no additional flakiness
> introduced?

My patch introduces additional flakiness. 😅

> It is very important that we keep the flakiness at a minimum to
> make sure the Windows CI system can keep up with the queue and provide
> continuous test coverage.

I agree.
Comment 22 Fujii Hironori 2021-01-14 16:13:46 PST
Created attachment 417667 [details]
Patch
Comment 23 Fujii Hironori 2021-01-14 16:31:47 PST
Created attachment 417669 [details]
Patch
Comment 24 Radar WebKit Bug Importer 2021-01-14 17:43:12 PST
<rdar://problem/73226316>
Comment 25 Fujii Hironori 2021-01-14 22:53:53 PST
Created attachment 417677 [details]
Patch
Comment 26 Fujii Hironori 2021-01-17 13:25:02 PST
AppleWin EWS reported a crash for js/dfg-inline-arguments-out-of-bounds.html

Callstack:

> WTF!abort+0x35
> WTF!WTF::fastMalloc+0x18
> WebKit!WTF::HashTable<WebCore::Element const *,WTF::KeyValuePair<WebCore::Element const *,WebCore::Style::ElementUpdates>,WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WebCore::Element const *,WebCore::Style::ElementUpdates> >,WTF::DefaultHash<WebCore::Element const *>,WTF::HashMap<WebCore::Element const *,WebCore::Style::ElementUpdates,WTF::DefaultHash<WebCore::Element const *>,WTF::HashTraits<WebCore::Element const *>,WTF::HashTraits<WebCore::Style::ElementUpdates> >::KeyValuePairTraits,WTF::HashTraits<WebCore::Element const *> >::rehash+0x5f
> WebKit!WTF::HashMap<WebCore::Element const *,WebCore::Style::ElementUpdates,WTF::DefaultHash<WebCore::Element const *>,WTF::HashTraits<WebCore::Element const *>,WTF::HashTraits<WebCore::Style::ElementUpdates> >::add<WebCore::Style::ElementUpdates>+0x240
> WebKit!WebCore::Style::TreeResolver::resolveComposedTree+0x5a4
> WebKit!WebCore::Style::TreeResolver::resolve+0x366
> WebKit!WebCore::Document::resolveStyle+0x29a
> WebKit!WebView::notifyPreferencesChanged+0x1239
> WebKit!WebView::onNotify+0x8b
> WebKit!WebNotificationCenter::postNotificationInternal+0xff
> WebKit!WebNotificationCenter::postNotificationName+0x3f
> WebKit!WebPreferences::postPreferencesChangesNotification+0x58
> WebKit!WebPreferences::setResizeObserverEnabled+0xa9
> DumpRenderTreeLib!resetWebPreferencesToConsistentValues+0xbb
> DumpRenderTreeLib!resetWebViewToConsistentStateBeforeTesting+0x2ac
> DumpRenderTreeLib!runTest+0xbc0
> DumpRenderTreeLib!main+0x5d3
> DumpRenderTree!main+0x88b
> DumpRenderTree!__scrt_common_main_seh+0x10c
> KERNEL32!BaseThreadInitThunk+0x14
> ntdll!RtlUserThreadStart+0x21

This looks like out of memory under resetWebPreferencesToConsistentValues.
I don't think this crash is relevant to this patch.
If this crash happens frequently, I think DRT should load a blank page before reseting prefs (Bug 220145 comment 8).
Comment 27 Fujii Hironori 2021-01-17 13:29:07 PST
Created attachment 417782 [details]
Patch
Comment 28 Fujii Hironori 2021-01-17 16:07:59 PST
Created attachment 417785 [details]
Patch
Comment 29 Per Arne Vollan 2021-01-18 13:57:40 PST
Comment on attachment 417785 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=417785&action=review

R=me. It does not look like this patch adds additional flakiness, but it would be great if you could keep an eye on EWS after landing to make sure 🙂 It usually takes a few EWS iterations to detect new flakiness.

> Tools/DumpRenderTree/win/DumpRenderTree.cpp:1298
> +            PostQuitMessage(0);

Is it ok to call this function multiple times during the lifetime of the process?
Comment 30 Fujii Hironori 2021-01-18 16:10:45 PST
Comment on attachment 417785 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=417785&action=review

Thank you for the review. I'll keep my eyes on EWS.

>> Tools/DumpRenderTree/win/DumpRenderTree.cpp:1298
>> +            PostQuitMessage(0);
> 
> Is it ok to call this function multiple times during the lifetime of the process?

Because WM_QUIT can be consumed by other PeekMessage and GetMessage,
I should post WM_QUIT until the outer most GetMessage quits.
I confirmed multiple PostQuitMessage don't post multiple WM_QUIT.
Comment 31 Fujii Hironori 2021-01-18 16:14:27 PST
Comment on attachment 417785 [details]
Patch

Clearing flags on attachment: 417785

Committed r271593: <https://trac.webkit.org/changeset/271593>
Comment 32 Fujii Hironori 2021-01-18 16:14:31 PST
All reviewed patches have been landed.  Closing bug.