Bug 195073 - Assertion Failed: m_databaseQueue.isKilled() in UniqueIDBDatabase::~UniqueIDBDatabase()
Summary: Assertion Failed: m_databaseQueue.isKilled() in UniqueIDBDatabase::~UniqueIDB...
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: 2019-02-26 15:47 PST by Sihui Liu
Modified: 2019-03-06 11:21 PST (History)
7 users (show)

See Also:


Attachments
Patch (6.87 KB, patch)
2019-02-27 12:35 PST, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch (7.41 KB, patch)
2019-02-27 15:25 PST, Sihui Liu
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews114 for mac-highsierra (2.38 MB, application/zip)
2019-02-27 16:55 PST, EWS Watchlist
no flags Details
Patch (7.35 KB, patch)
2019-02-28 09:45 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 2019-02-26 15:47:00 PST
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
-> 76  	    RELEASE_ASSERT(m_databaseQueue.isKilled());
0   com.apple.WebCore             	0x00000001010f8b23 WTFCrashWithInfo(int, char const*, char const*, int) + 19
1   com.apple.WebCore             	0x00000001019fc890 WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase() + 2576
2   com.apple.WebCore             	0x00000001019d04ef WebCore::IDBServer::IDBServer::~IDBServer() + 287
3   com.apple.WebCore             	0x00000001019c503e WebCore::IDBServer::IDBServer::~IDBServer() + 14
4   com.apple.WebCore             	0x0000000101a26785 WebCore::InProcessIDBServer::~InProcessIDBServer() + 341
5   com.apple.WebCore             	0x0000000101a2609e WebCore::InProcessIDBServer::~InProcessIDBServer() + 14
6   com.apple.WebCore             	0x0000000101a29aa7 WTF::Function<void ()>::CallableWrapper<WebCore::InProcessIDBServer::databaseConnectionClosed(unsigned long long)::$_43>::~CallableWrapper() + 55
7   com.apple.JavaScriptCore      	0x000000010429c503 WTF::RunLoop::performWork() + 515
8   com.apple.JavaScriptCore      	0x000000010429c672 WTF::RunLoop::performWork(void*) + 34
9   com.apple.CoreFoundation      	0x00007fff312225e3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17

r239887 removes a retain cycle between IDBConnectionToClientDelegate and IDBConnectionToClient, so IDBConnectionToClientDelegate(InProcessIDBServer) no longer live forever and can be destructed before shutdown of UniqueIDBDatabase finishes.
Comment 1 Sihui Liu 2019-02-26 15:48:01 PST
<rdar://problem/48285200>
Comment 2 Sihui Liu 2019-02-27 12:35:16 PST
Created attachment 363116 [details]
Patch
Comment 3 Sihui Liu 2019-02-27 15:25:53 PST
Created attachment 363139 [details]
Patch
Comment 4 EWS Watchlist 2019-02-27 16:55:51 PST
Comment on attachment 363139 [details]
Patch

Attachment 363139 [details] did not pass mac-debug-ews (mac):
Output: https://webkit-queues.webkit.org/results/11309111

New failing tests:
webgl/2.0.0/conformance/context/context-release-upon-reload.html
Comment 5 EWS Watchlist 2019-02-27 16:55:53 PST
Created attachment 363157 [details]
Archive of layout-test-results from ews114 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 6 Sihui Liu 2019-02-28 09:45:53 PST
Created attachment 363231 [details]
Patch
Comment 7 Geoffrey Garen 2019-02-28 11:28:21 PST
Comment on attachment 363231 [details]
Patch

Can you add a test for this?
Comment 8 Sihui Liu 2019-03-06 10:54:03 PST
(In reply to Geoffrey Garen from comment #7)
> Comment on attachment 363231 [details]
> Patch
> 
> Can you add a test for this?

For testing, we need to make sure ~IDBDatabase() and ~InProcessIDBServer() happen before the shutdown of UniqueIDBDatabase. For layout test, this means all WebPages using the same WebDatabaseProvider(the same webPageGroupID) should go away before UniqueIDBDatabase finishes its tasks. We can create a webpage with IDBDatabase by using window.open and then close it, but we cannot close all the other pages in the same group and force InProcessIDBServer to go away.

We can probably make this test work by making WebDatabaseProvider not per page group but per page, but that seems not to be the correct direction.
Comment 9 WebKit Commit Bot 2019-03-06 11:20:59 PST
Comment on attachment 363231 [details]
Patch

Clearing flags on attachment: 363231

Committed r242555: <https://trac.webkit.org/changeset/242555>
Comment 10 WebKit Commit Bot 2019-03-06 11:21:00 PST
All reviewed patches have been landed.  Closing bug.