| Summary: | Crash under WebKit: WTF::Function<void ()>::CallableWrapper<WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords(WTF::CompletionHandler<void ()>&&)::$_1>::call() | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||
| Component: | WebKit2 | Assignee: | Chris Dumez <cdumez> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | achristensen, bfulgham, commit-queue, ddkilzer, ggaren, webkit-bug-importer, youennf | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Chris Dumez
2018-08-29 14:39:44 PDT
Created attachment 348434 [details]
Patch
Comment on attachment 348434 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=348434&action=review > Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.cpp:246 > It seems that callback here is a completion handler. There is no guarantee though that it will be called if the workQueue is stopped. Maybe it should be WTF::Function(). Also, is it fine that callback be destroyed in the main thread? From my reading of the code, it seems ok right now since the passed callbacks are capturing weakThis, but it would be quite easy to break that assumption. Maybe removeDataRecords should not take a callback at all. Instead, it could create the callback itself when being called, this would remove this double weakThis check and be more future proof. (In reply to youenn fablet from comment #3) > Comment on attachment 348434 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=348434&action=review > > > Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.cpp:246 > > > > It seems that callback here is a completion handler. > There is no guarantee though that it will be called if the workQueue is > stopped. Maybe it should be WTF::Function(). > > Also, is it fine that callback be destroyed in the main thread? > From my reading of the code, it seems ok right now since the passed > callbacks are capturing weakThis, but it would be quite easy to break that > assumption. > > Maybe removeDataRecords should not take a callback at all. > Instead, it could create the callback itself when being called, this would > remove this double weakThis check and be more future proof. If you do a WorkQueue::dispatch(c), c is *guaranteed* to run. Comment on attachment 348434 [details] Patch Clearing flags on attachment: 348434 Committed r235487: <https://trac.webkit.org/changeset/235487> All reviewed patches have been landed. Closing bug. |