Bug 153038

Summary: Modern IDB: A few cursor tests are flaky because JS wrappers are GC'ed
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebCore Misc.Assignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen
Priority: P2    
Version: Safari 9   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 149117    
Attachments:
Description Flags
Patch v1 achristensen: review+

Brady Eidson
Reported 2016-01-12 13:58:32 PST
Modern IDB: A few cursor tests are flaky because JS wrappers are GC'ed storage/indexeddb/cursor-update.html storage/indexeddb/mutating-cursor.html https://build.webkit.org/results/Apple%20Yosemite%20Release%20WK1%20(Tests)/r194903%20(11144)/results.html https://build.webkit.org/results/Apple%20Yosemite%20Release%20WK1%20(Tests)/r194901%20(11142)/results.html You can see on the flakiness dashboard that on debug bots they are crashes: https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#tests=storage%2Findexeddb%2Fmutating-cursor.html But really ASSERTs. I verified running these tests repeatedly with some logging that the IDBRequest answered "false" to hasPendingActivity(), leading to its JS wrapper to get GC'ed, but then an event was delivered. The ASSERTs in debug builds are just that: inline JSC::JSObject* JSEventListener::jsFunction(ScriptExecutionContext* scriptExecutionContext) const ... ASSERT(!m_isolatedWorld->isNormal() || m_wrapper || !m_jsFunction); IDBRequests for cursors operations can be reused and must maintain a "true" answer to this question while a cursor operation is outstanding.
Attachments
Patch v1 (11.76 KB, patch)
2016-01-13 09:11 PST, Brady Eidson
achristensen: review+
Brady Eidson
Comment 1 2016-01-13 09:11:50 PST
Created attachment 268871 [details] Patch v1
Alex Christensen
Comment 2 2016-01-13 10:30:01 PST
Comment on attachment 268871 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=268871&action=review r=me > Source/WebCore/bindings/js/JSIDBCursorCustom.cpp:42 > + auto& modernCursor = static_cast<IDBClient::IDBCursor&>(wrapped()); Is this static_cast necessary? Other visitAdditionalChildren implementations don't have it.
Alex Christensen
Comment 3 2016-01-13 10:37:14 PST
Comment on attachment 268871 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=268871&action=review >> Source/WebCore/bindings/js/JSIDBCursorCustom.cpp:42 >> + auto& modernCursor = static_cast<IDBClient::IDBCursor&>(wrapped()); > > Is this static_cast necessary? Other visitAdditionalChildren implementations don't have it. Ok, but this will be removed when we get rid of the legacy implementation. Same with isModernCursor.
Brady Eidson
Comment 4 2016-01-13 10:42:31 PST
Note You need to log in before you can comment on or make changes to this bug.