| Summary: | [Win] StreamServerConnection is leaking Connection in GPU process | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Fujii Hironori <Hironori.Fujii> | ||||||||
| Component: | WebKit2 | Assignee: | Fujii Hironori <Hironori.Fujii> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | Normal | CC: | kkinnunen, webkit-bug-importer | ||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||
| Version: | WebKit Nightly Build | ||||||||||
| Hardware: | Unspecified | ||||||||||
| OS: | Unspecified | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Fujii Hironori
2023-05-02 00:23:05 PDT
Created attachment 466169 [details]
connection-leak-debug-logging.patch
Created attachment 466170 [details]
Adding Sleep
Adding Sleep() in Connection::dispatchDidCloseAndInvalidate works around the problem.
Created attachment 466267 [details]
WIP patch
Connection::dispatchDidCloseAndInvalidate is using Connection::dispatchToClient.
However, Connection::dispatchToClient doesn't work in the RemoteGraphicsContextGL work queue because the thread isn't using RunLoop.
This problem can be fixed by using RunLoop::main() instead of using RunLoop::current() in the RemoteGraphicsContextGL work queue.
But, this patch introduces a new assertion failure for comment#0's steps. ASSERTION FAILED: this == ¤t() C:\home\webkit\gb\Source\WTF\wtf\RunLoop.cpp(209) : WTF::RunLoop::assertIsCurrent 1 00007FFEB60B26FB WTFCrash 2 00007FFEB60B77FD WTFCrashWithInfo 3 00007FFEB615C73D WTF::RunLoop::assertIsCurrent 4 00007FFE78E0D6EA WTF::assertIsCurrent 5 00007FFE78DF1B1F IPC::Connection::dispatcher 6 00007FFE78DEC3C8 IPC::Connection::invalidate 7 00007FFE78E31FE3 IPC::StreamServerConnection::invalidate 8 00007FFE788EF905 WebKit::RemoteGraphicsContextGL::workQueueUninitialize 9 00007FFE788F10AF `WebKit::RemoteGraphicsContextGL::stopListeningForIPC'::`2'::<lambda_1>::operator() 10 00007FFE788F288B WTF::Detail::CallableWrapper<`WebKit::RemoteGraphicsContextGL::stopListeningForIPC'::`2'::<lambda_1>,void>::call 11 00007FFE77E0D554 WTF::Function<void __cdecl(void)>::operator() 12 00007FFE78E33C08 IPC::StreamConnectionWorkQueue::processStreams 13 00007FFE78E33E95 `IPC::StreamConnectionWorkQueue::startProcessingThread'::`2'::<lambda_1>::operator() 14 00007FFE78E343CB WTF::Detail::CallableWrapper<`IPC::StreamConnectionWorkQueue::startProcessingThread'::`2'::<lambda_1>,void>::call 15 00007FFEB60C9D93 WTF::Function<void __cdecl(void)>::operator() 16 00007FFEB616B558 WTF::Thread::entryPoint 17 00007FFEB6244BC4 WTF::wtfThreadEntryPoint 18 00007FFF6B761BB2 configthreadlocale 19 00007FFF6D4B7604 BaseThreadInitThunk 20 00007FFF6D9226A1 RtlUserThreadStart Adding Sleep() works around the leakage problem (comment#2). Connection::invalidate is called in the other thread during the sleep. Connection::dispatchToClient does nothing after invalidated. Pull request: https://github.com/WebKit/WebKit/pull/13562 264465@main (bug#249769) fixed the problem. |