Bug 197366

Summary: Add assertions to catch NetworkProcess null CompletionHandler dispatching
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: REOPENED ---    
Severity: Normal CC: benjamin, cdumez, cgarcia, cmarcelo, dbates, ews-watchlist
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
cdumez: review+, ews-watchlist: commit-queue-
Archive of layout-test-results from ews215 for win-future none

Description Alex Christensen 2019-04-29 06:48:01 PDT
Assert Function is non-null in RunLoop::dispatch
Comment 1 Alex Christensen 2019-04-29 06:48:35 PDT
Created attachment 368452 [details]
Patch
Comment 2 Chris Dumez 2019-04-29 08:44:22 PDT
Comment on attachment 368452 [details]
Patch

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

> Source/WTF/wtf/RunLoop.cpp:129
> +    RELEASE_ASSERT(function);

I am not convinced this will help us debug rdar://problem/48679972 since in rdar://problem/48679972 we're crashing when trying to call a CompletionHandler, not a Function. I think what ends up happening is that somebody calls dispatch() with a Function that wraps a CompletionHandler whose m_function is null.
This case would not get caught by your proposed assertion.
Comment 3 Alex Christensen 2019-05-06 16:19:52 PDT
Reopening to try a different approach.
Comment 4 Alex Christensen 2019-05-06 16:20:47 PDT
Created attachment 369194 [details]
Patch
Comment 5 Chris Dumez 2019-05-06 16:31:14 PDT
Comment on attachment 369194 [details]
Patch

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

> Source/WebKit/ChangeLog:10
> +        * NetworkProcess/cache/CacheStorageEngine.cpp:

Why only these 4? It seems there are other calls to RunLoop::main().dispatch() in the networkProcess which pass a CompletionHandler. E.g. saveCookies() in NetworkProcessCocoa.
Comment 6 Alex Christensen 2019-05-06 18:04:34 PDT
I've decided to try https://bugs.webkit.org/show_bug.cgi?id=197641 instead
Comment 7 EWS Watchlist 2019-05-06 22:49:12 PDT
Comment on attachment 369194 [details]
Patch

Attachment 369194 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/12119790

New failing tests:
http/tests/css/filters-on-iframes.html
Comment 8 EWS Watchlist 2019-05-06 22:49:14 PDT
Created attachment 369236 [details]
Archive of layout-test-results from ews215 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews215  Port: win-future  Platform: CYGWIN_NT-10.0-17763-3.0.5-338.x86_64-x86_64-64bit