WebKit Bugzilla
Attachment 340421 Details for
Bug 185653
: Fix crash after a Worker terminates but there are still IDB transactions the server is trying to open for it
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185653-20180515111130.patch (text/plain), 5.54 KB, created by
Brady Eidson
on 2018-05-15 11:11:31 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Brady Eidson
Created:
2018-05-15 11:11:31 PDT
Size:
5.54 KB
patch
obsolete
>Subversion Revision: 231801 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 8a937ff3a32bea716f395ed233ba88e00680edd6..c88f40e5e1990cfeb28c0a35d6bd0c7ff3754610 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,16 @@ >+2018-05-15 Brady Eidson <beidson@apple.com> >+ >+ Fix crash after a Worker terminates but there are still IDB transactions the server is trying to open for it. >+ <rdar://problem/33744241> and https://bugs.webkit.org/show_bug.cgi?id=185653 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: storage/indexeddb/modern/worker-transaction-open-after-worker-stop.html >+ >+ * Modules/indexeddb/client/IDBConnectionProxy.cpp: >+ (WebCore::IDBClient::IDBConnectionProxy::didStartTransaction): It's okay to not be able to find a pending TX >+ that the server has started. e.g. When it was a WebWorker that asked for the TX but it has since terminated. >+ > 2018-05-15 Carlos Alberto Lopez Perez <clopez@igalia.com> > > [WPE] Build failure with RPi userland drivers and gstreamer-gl >diff --git a/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp b/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp >index 742a77a4d985c540ecd2b17b3211502dafcf2ecf..15ac07e46445f43414d45f8b128666cb27c4c00c 100644 >--- a/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp >+++ b/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp >@@ -316,7 +316,8 @@ void IDBConnectionProxy::didStartTransaction(const IDBResourceIdentifier& transa > transaction = m_pendingTransactions.take(transactionIdentifier); > } > >- ASSERT(transaction); >+ if (!transaction) >+ return; > > transaction->performCallbackOnOriginThread(*transaction, &IDBTransaction::didStart, error); > } >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 6eb154f106dd4ef52a788c5a6a4159e2810cd604..e3b3f480d06c15d1ddf8e6ab3aa5f49ced4a6bbf 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,18 @@ >+2018-05-15 Brady Eidson <beidson@apple.com> >+ >+ Fix crash after a Worker terminates but there are still IDB transactions the server is trying to open for it. >+ <rdar://problem/33744241> and https://bugs.webkit.org/show_bug.cgi?id=185653 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * storage/indexeddb/modern/resources/worker-transaction-open-after-worker-stop.js: Added. >+ (const.errorHandler): >+ (openRequest.onupgradeneeded): >+ (tx.oncomplete): >+ (openRequest.onsuccess): >+ (deleteRequest.onerror.deleteRequest.onblocked.deleteRequest.onsuccess): >+ * storage/indexeddb/modern/worker-transaction-open-after-worker-stop.html: Added. >+ > 2018-05-15 Dirk Schulze <krit@webkit.org> > > Add new SVGDOM SVGFEBLEND constants >diff --git a/LayoutTests/storage/indexeddb/modern/resources/worker-transaction-open-after-worker-stop.js b/LayoutTests/storage/indexeddb/modern/resources/worker-transaction-open-after-worker-stop.js >new file mode 100644 >index 0000000000000000000000000000000000000000..99ad76d3009cdfe790ec56c5b93c715828124971 >--- /dev/null >+++ b/LayoutTests/storage/indexeddb/modern/resources/worker-transaction-open-after-worker-stop.js >@@ -0,0 +1,35 @@ >+const errorHandler = function (event) { >+ console.error(event.target.error); >+} >+ >+console.log('Deleting database...'); >+var deleteRequest = indexedDB.deleteDatabase('test'); >+deleteRequest.onerror = deleteRequest.onblocked = deleteRequest.onsuccess = function () { >+ console.log('Opening database...'); >+ var openRequest = indexedDB.open('test'); >+ openRequest.onerror = errorHandler; >+ openRequest.onupgradeneeded = function () { >+ var db = openRequest.result; >+ db.createObjectStore('test', {keyPath: 'a'}); >+ } >+ openRequest.onsuccess = function (event) { >+ var db = event.target.result; >+ var hasMessagedBack = false; >+ >+ // Queue up many transactions. >+ // We'll kill the worker from the main thread after the first transaction completes, >+ // meaning there will be many more that would trigger the crash after the worker is gone. >+ for (var i = 0; i < 1000; ++i) { >+ var tx = db.transaction('test', 'readwrite'); >+ tx.onerror = errorHandler; >+ tx.onabort = errorHandler; >+ tx.oncomplete = function () { >+ console.log('All done!'); >+ if (!hasMessagedBack) { >+ hasMessagedBack = true; >+ postMessage('First transaction completed'); >+ } >+ }; >+ } >+ }; >+}; >diff --git a/LayoutTests/storage/indexeddb/modern/worker-transaction-open-after-worker-stop.html b/LayoutTests/storage/indexeddb/modern/worker-transaction-open-after-worker-stop.html >new file mode 100644 >index 0000000000000000000000000000000000000000..58e61767872ec1ecf3c34b4a68ad7a25bd631fec >--- /dev/null >+++ b/LayoutTests/storage/indexeddb/modern/worker-transaction-open-after-worker-stop.html >@@ -0,0 +1,25 @@ >+<script type="text/javascript"> >+if (testRunner) { >+ testRunner.dumpAsText(); >+ testRunner.waitUntilDone(); >+} >+ >+function finishTest() >+{ >+ if (testRunner) >+ testRunner.notifyDone(); >+} >+ >+var w = new Worker('resources/worker-transaction-open-after-worker-stop.js'); >+w.onmessage = function() { >+ w.terminate(); >+ >+ // Queue up an "open" that will necessarily queue up behind the many >+ // transactions that the Worker queued up. >+ indexedDB.open('test').onsuccess = function (event) { >+ finishTest(); >+ }; >+} >+ >+</script> >+If this test completes without crashing, it passed.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185653
: 340421 |
340422