Bug 155131

Summary: (Crash) storage/indexeddb/intversion-open-in-upgradeneeded.html crashes intermittently on mac-wk2
Product: WebKit Reporter: Ryan Haddad <ryanhaddad>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: beidson
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=155050
Bug Depends on:    
Bug Blocks: 154968    

Description Ryan Haddad 2016-03-07 13:43:40 PST
storage/indexeddb/intversion-open-in-upgradeneeded.html crashes intermittently on mac-wk2

<http://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=storage%2Findexeddb%2Fintversion-open-in-upgradeneeded.html>

Thread 4 Crashed:: IndexedDatabase Server
0   com.apple.JavaScriptCore      	0x0000000112d3e267 WTFCrash + 39 (Assertions.cpp:322)
1   com.apple.WebCore             	0x0000000116f28598 WebCore::SQLiteTransaction::begin() + 88 (SQLiteTransaction.cpp:53)
2   com.apple.WebCore             	0x0000000116f1f02e WebCore::IDBServer::SQLiteIDBTransaction::begin(WebCore::SQLiteDatabase&) + 974 (SQLiteIDBTransaction.cpp:62)
3   com.apple.WebCore             	0x0000000116f097ec WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction(WebCore::IDBTransactionInfo const&) + 1628 (SQLiteIDBBackingStore.cpp:628)
4   com.apple.WebCore             	0x0000000117254005 WebCore::IDBServer::UniqueIDBDatabase::beginTransactionInBackingStore(WebCore::IDBTransactionInfo const&) + 117 (UniqueIDBDatabase.cpp:401)
5   com.apple.WebCore             	0x000000011727d4ef WebCore::CrossThreadTaskImpl<WebCore::IDBServer::UniqueIDBDatabase, WebCore::IDBTransactionInfo const&>::CrossThreadTaskImpl(WebCore::IDBServer::UniqueIDBDatabase*, void (WebCore::IDBServer::UniqueIDBDatabase::*)(WebCore::IDBTransactionInfo const&), WebCore::IDBTransactionInfo const&)::'lambda'()::operator()() const + 127 (CrossThreadTask.h:61)
6   com.apple.WebCore             	0x000000011727d45d _ZNSt3__128__invoke_void_return_wrapperIvE6__callIJRZN7WebCore19CrossThreadTaskImplINS3_9IDBServer17UniqueIDBDatabaseEJRKNS3_18IDBTransactionInfoEEEC1EPS6_MS6_FvS9_ES9_EUlvE_EEEvDpOT_ + 45 (__functional_base:441)
7   com.apple.WebCore             	0x000000011727d2ec std::__1::__function::__func<WebCore::CrossThreadTaskImpl<WebCore::IDBServer::UniqueIDBDatabase, WebCore::IDBTransactionInfo const&>::CrossThreadTaskImpl(WebCore::IDBServer::UniqueIDBDatabase*, void (WebCore::IDBServer::UniqueIDBDatabase::*)(WebCore::IDBTransactionInfo const&), WebCore::IDBTransactionInfo const&)::'lambda'(), std::__1::allocator<WebCore::CrossThreadTaskImpl<WebCore::IDBServer::UniqueIDBDatabase, WebCore::IDBTransactionInfo const&>::CrossThreadTaskImpl(WebCore::IDBServer::UniqueIDBDatabase*, void (WebCore::IDBServer::UniqueIDBDatabase::*)(WebCore::IDBTransactionInfo const&), WebCore::IDBTransactionInfo const&)::'lambda'()>, void ()>::operator()() + 44 (functional:1407)
8   com.apple.WebCore             	0x0000000114e8e29a std::__1::function<void ()>::operator()() const + 26 (functional:1793)
9   com.apple.WebCore             	0x0000000115beec75 WebCore::CrossThreadTask::performTask() + 21 (CrossThreadTask.h:46)
10  com.apple.WebCore             	0x0000000115beca53 WebCore::IDBServer::IDBServer::databaseRunLoop() + 275 (IDBServer.cpp:414)
11  com.apple.WebCore             	0x0000000115bea5e4 WebCore::IDBServer::IDBServer::databaseThreadEntry(void*) + 84 (IDBServer.cpp:404)
12  com.apple.JavaScriptCore      	0x0000000112da9389 WTF::createThread(void (*)(void*), void*, char const*)::$_0::operator()() const + 25 (Threading.cpp:82)
13  com.apple.JavaScriptCore      	0x0000000112da935d void std::__1::__invoke_void_return_wrapper<void>::__call<WTF::createThread(void (*)(void*), void*, char const*)::$_0&>(WTF::createThread(void (*)(void*), void*, char const*)::$_0&&&) + 45 (__functional_base:441)
14  com.apple.JavaScriptCore      	0x0000000112da92fc std::__1::__function::__func<WTF::createThread(void (*)(void*), void*, char const*)::$_0, std::__1::allocator<WTF::createThread(void (*)(void*), void*, char const*)::$_0>, void ()>::operator()() + 44 (functional:1407)
15  com.apple.JavaScriptCore      	0x0000000112656d0a std::__1::function<void ()>::operator()() const + 26 (functional:1793)
16  com.apple.JavaScriptCore      	0x0000000112da805e WTF::threadEntryPoint(void*) + 158 (Threading.cpp:58)
17  com.apple.JavaScriptCore      	0x0000000112da98f1 WTF::wtfThreadEntryPoint(void*) + 289 (ThreadingPthreads.cpp:164)
18  libsystem_pthread.dylib       	0x00007fff91e87c13 _pthread_body + 131
19  libsystem_pthread.dylib       	0x00007fff91e87b90 _pthread_start + 168
20  libsystem_pthread.dylib       	0x00007fff91e85375 thread_start + 13

Full crashlog:
<https://build.webkit.org/results/Apple%20El%20Capitan%20Debug%20WK2%20(Tests)/r197696%20(3498)/storage/indexeddb/intversion-open-in-upgradeneeded-crash-log.txt>
Comment 1 Ryan Haddad 2016-03-07 15:18:46 PST
<rdar://problem/25015010>
Comment 2 Brady Eidson 2016-03-25 15:26:30 PDT
I think this was the "too many file handles open at once" problem.
Comment 3 Brady Eidson 2016-03-25 15:27:10 PDT
Which I fixed in http://trac.webkit.org/changeset/197474
Comment 4 Brady Eidson 2016-03-25 15:27:58 PDT
(In reply to comment #3)
> Which I fixed in http://trac.webkit.org/changeset/197474

Which was, sadly, a few days before Ryan filed this...  =/ Grumble.
Comment 5 Brady Eidson 2016-03-25 15:30:15 PDT
Regardless, it is the same problem. With the entire test suite cruising along, and with the unpredictability of GC, and with some leaks still outstanding, we're clearly keeping some file handles open that we don't need.

Fixing leaks is going to be one way out of this mess.

Another is:
https://bugs.webkit.org/show_bug.cgi?id=154923
Comment 6 Brady Eidson 2016-06-03 16:44:35 PDT
According to the dashboard:
- This test hasn't crashed in recent recorded history.
- This test stopped timing out mid May-27th, which jives with my fix http://trac.webkit.org/changeset/201461
- This test is still flaking on text results quite often.
Comment 7 Brady Eidson 2016-06-03 16:45:07 PDT
My fix on 5/27 also jives with the nature of the crash log.

I'm confident it made an impact here.
Comment 8 Brady Eidson 2016-06-03 16:47:02 PDT
The text diff is always about the blocked event:
--- /Volumes/Data/slave/yosemite-debug-tests-wk2/build/layout-test-results/storage/indexeddb/intversion-open-in-upgradeneeded-expected.txt
+++ /Volumes/Data/slave/yosemite-debug-tests-wk2/build/layout-test-results/storage/indexeddb/intversion-open-in-upgradeneeded-actual.txt
@@ -34,8 +34,6 @@
 onVersionChange():
 db.close()
 
-onBlocked():
-
 upgradeNeeded2():
 db = event.target.result
 PASS event.newVersion is 3
----

This is basically the same flakiness issue as https://bugs.webkit.org/show_bug.cgi?id=155050

This can be resolved with a test change (getting the blocked event is not relevant to the test, and blocked events are well tested elsewhere)
Comment 9 Brady Eidson 2016-06-03 16:49:12 PDT
Okay, hilarious - This is actually the SAME TEST as 155050.

The change has already been made.

We're good here.

*** This bug has been marked as a duplicate of bug 155050 ***