Bug 208457 - Assertion failed: !m_function in CompletionHandler::~CompletionHandler()
Summary: Assertion failed: !m_function in CompletionHandler::~CompletionHandler()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sihui Liu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-03-02 11:12 PST by Sihui Liu
Modified: 2020-03-04 11:37 PST (History)
6 users (show)

See Also:


Attachments
Patch (2.83 KB, patch)
2020-03-02 11:19 PST, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch (2.79 KB, patch)
2020-03-02 12:17 PST, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch for landing (2.76 KB, patch)
2020-03-04 11:09 PST, Sihui Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sihui Liu 2020-03-02 11:12:12 PST
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.JavaScriptCore      	0x00000001089edcde WTFCrash + 14 (Assertions.cpp:305)
1   com.apple.WebKit              	0x0000000110d39ff7 WTF::CompletionHandler<void (WTF::Vector<WebKit::WebResourceLoadStatisticsStore::ThirdPartyData, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)>::~CompletionHandler() + 87 (CompletionHandler.h:53)
2   com.apple.WebKit              	0x0000000110d38fb5 WTF::CompletionHandler<void (WTF::Vector<WebKit::WebResourceLoadStatisticsStore::ThirdPartyData, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)>::~CompletionHandler() + 21 (CompletionHandler.h:54)
3   com.apple.WebKit              	0x00000001115a89c9 -[WKWebsiteDataStore(WKPrivate) _getResourceLoadStatisticsDataSummary:] + 105 (WKWebsiteDataStore.mm:536)
Comment 1 Sihui Liu 2020-03-02 11:19:36 PST
Created attachment 392161 [details]
Patch
Comment 2 Chris Dumez 2020-03-02 11:53:58 PST
Comment on attachment 392161 [details]
Patch

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

> Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1522
> +    struct CallbackAggregator final : ThreadSafeRefCounted<CallbackAggregator> {

Why ThreadSafe?

> Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1536
> +        void completeCallback(Vector<WebResourceLoadStatisticsStore::ThirdPartyData>&& results)

Can we name this better? Maybe something like addResult(). This really does not have much to do with the callback.

> Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1538
> +            for (auto& result : results)

m_results.appendVector(WTFMove(results)) for performance.
Comment 3 Sihui Liu 2020-03-02 12:16:26 PST
Comment on attachment 392161 [details]
Patch

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

>> Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1522
>> +    struct CallbackAggregator final : ThreadSafeRefCounted<CallbackAggregator> {
> 
> Why ThreadSafe?

Not necessary to be ThreadSafe in this case as long as async reply is handled on main thread. Just to be consistent with other CallbackAggregators.

>> Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1536
>> +        void completeCallback(Vector<WebResourceLoadStatisticsStore::ThirdPartyData>&& results)
> 
> Can we name this better? Maybe something like addResult(). This really does not have much to do with the callback.

Okay.

>> Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1538
>> +            for (auto& result : results)
> 
> m_results.appendVector(WTFMove(results)) for performance.

Sure.
Comment 4 Sihui Liu 2020-03-02 12:17:56 PST
Created attachment 392170 [details]
Patch
Comment 5 WebKit Commit Bot 2020-03-04 10:59:55 PST
Comment on attachment 392170 [details]
Patch

Rejecting attachment 392170 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'land-attachment', '--force-clean', '--non-interactive', '--parent-command=commit-queue', 392170, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Logging in as commit-queue@webkit.org...
Fetching: https://bugs.webkit.org/attachment.cgi?id=392170&action=edit
Fetching: https://bugs.webkit.org/show_bug.cgi?id=208457&ctype=xml&excludefield=attachmentdata
Processing 1 patch from 1 bug.
Updating working directory
Processing patch 392170 from bug 208457.
Fetching: https://bugs.webkit.org/attachment.cgi?id=392170
Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force', '--reviewer', u'Chris Dumez']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Parsed 2 diffs from patch file(s).
patching file Source/WebKit/ChangeLog
Hunk #1 succeeded at 1 with fuzz 3.
patching file Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
Hunk #1 FAILED at 1519.
1 out of 1 hunk FAILED -- saving rejects to file Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp.rej

Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force', '--reviewer', u'Chris Dumez']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Parsed 2 diffs from patch file(s).
patching file Source/WebKit/ChangeLog
Hunk #1 succeeded at 1 with fuzz 3.
patching file Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
Hunk #1 FAILED at 1519.
1 out of 1 hunk FAILED -- saving rejects to file Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp.rej

Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force', '--reviewer', u'Chris Dumez']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit
Updating OpenSource
From git://git.webkit.org/WebKit
   966e9850239..0a60812f941  master     -> origin/master
Partial-rebuilding .git/svn/refs/remotes/origin/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc ...
Currently at 257854 = 966e9850239dc5c2012aab350aa990e5c73a063f
r257855 = 3483be115a2459e9240b96ffe591b8a6c83ecd1e
r257856 = 61155812937193b3898d2e958db070299d3837ee
r257857 = 2082772a8b600fa67c35bff4319d2ac921e72c0c
r257858 = 2c649a99bda9bc8683eb22b39755415e0b3fdd86
r257859 = 6533465765f7759e7c3f160d3edd0271ae8f643a
r257860 = e2220183f268e8463339f70aef12ebf62f4b7b80
r257861 = 0a60812f941902e48fb997b9143fb9b25494fd31
Done rebuilding .git/svn/refs/remotes/origin/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/origin/master.

Full output: https://webkit-queues.webkit.org/results/13333561
Comment 6 Sihui Liu 2020-03-04 11:09:43 PST
Created attachment 392443 [details]
Patch for landing
Comment 7 WebKit Commit Bot 2020-03-04 11:36:04 PST
Comment on attachment 392443 [details]
Patch for landing

Clearing flags on attachment: 392443

Committed r257866: <https://trac.webkit.org/changeset/257866>
Comment 8 WebKit Commit Bot 2020-03-04 11:36:05 PST
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2020-03-04 11:37:14 PST
<rdar://problem/60049004>