Bug 186361

Summary: [Win] Fix WorkQueue crash
Product: WebKit Reporter: Basuke Suzuki <Basuke.Suzuki>
Component: Web Template FrameworkAssignee: Basuke Suzuki <Basuke.Suzuki>
Status: RESOLVED INVALID    
Severity: Normal CC: Basuke.Suzuki, Hironori.Fujii
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
WIP - first trial none

Description Basuke Suzuki 2018-06-06 13:51:05 PDT
WorkQueue::handleCallback was called after WorkQueue::unregisterAndCloseHandle.
Comment 1 Basuke Suzuki 2018-06-06 13:52:58 PDT
Created attachment 342080 [details]
WIP - first trial
Comment 2 Fujii Hironori 2018-06-06 17:56:10 PDT
It's easy to reproduce this crash by using TestWebKit.
Comment 3 Basuke Suzuki 2018-06-07 08:50:45 PDT
Fujihiro>

Question about your patch. This removes the consideration mentioned here:

    // We're going to make a blocking call to ::UnregisterWaitEx before closing the handle. (The
    // blocking version of ::UnregisterWaitEx is much simpler than the non-blocking version.) If we
    // do this on the current thread, we'll deadlock if we're currently in a callback function for
    // the wait we're unregistering. So instead we do it asynchronously on some other worker thread.

I'm not sure this happens in actual use case, but it seems possible. To solve that, how about adding a invalid flag to WorkItemContext? Then we can avoid invocation in a handleCallback after unregisterAndCloseHandle.
Comment 4 Fujii Hironori 2018-06-07 21:01:25 PDT
Year. My patch doesn't do thinkgs right. But, it works for me at least for running WinCairo WK2 stably.
Comment 5 Basuke Suzuki 2018-06-14 11:58:47 PDT
This bug will be handled in https://bugs.webkit.org/show_bug.cgi?id=186582 .