Bug 186361 - [Win] Fix WorkQueue crash
Summary: [Win] Fix WorkQueue crash
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Basuke Suzuki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-06 13:51 PDT by Basuke Suzuki
Modified: 2018-06-14 11:58 PDT (History)
2 users (show)

See Also:


Attachments
WIP - first trial (3.84 KB, patch)
2018-06-06 13:52 PDT, Basuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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 .