Bug 143451

Summary: [WK2][iOS] Regression(r182323): ASSERTION FAILED: WebCore::SQLiteDatabaseTracker::hasTransactionInProgress() in NetworkCache::Statistics::initialize()
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, koivisto, mitz, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 143278    
Attachments:
Description Flags
Patch none

Description Chris Dumez 2015-04-06 12:35:22 PDT
We sometimes hit the following assertion:
ASSERTION FAILED: WebCore::SQLiteDatabaseTracker::hasTransactionInProgress() in NetworkCache::Statistics::initialize()

0x107ff3020 WTFCrash
0x1036fe3fc WebKit::NetworkCache::executeSQLCommand(WebCore::SQLiteDatabase&, WTF::String const&)
0x1036fdaaa WebKit::NetworkCache::Statistics::initialize(WTF::String const&)::$_0::operator()() const
0x1036fd6bc std::__1::__function::__func<WebKit::NetworkCache::Statistics::initialize(WTF::String const&)::$_0, std::__1::allocator<WebKit::NetworkCache::Statistics::initialize(WTF::String const&)::$_0>, void ()>::operator()()
0x107b4358a std::__1::function<void ()>::operator()() const
0x108014bb9 invocation function for block in WTF::WorkQueue::dispatch(std::__1::function<void ()>)
0x101beebfd _dispatch_call_block_and_release
0x101c0e40d _dispatch_client_callout
0x101bf50ff _dispatch_queue_drain
0x101bf46fc _dispatch_queue_invoke
0x101bf6c1f _dispatch_root_queue_drain
0x101bf66bc _dispatch_worker_thread3
0x101f308a6 _pthread_wqthread
0x101f2e0c5 start_wqthread

I do have a "WebCore::SQLiteTransactionInProgressAutoCounter transactionCounter" in NetworkCache::Statistics::initialize(). My current guess is that the SQLiteDatabaseTrackerClient can get set after transactionCounter is initialized but before executeSQLCommand() is called.
Comment 1 Chris Dumez 2015-04-06 13:06:18 PDT
I can reproduce. Working on a fix now.
Comment 2 Radar WebKit Bug Importer 2015-04-06 13:06:52 PDT
<rdar://problem/20437994>
Comment 3 Chris Dumez 2015-04-06 13:17:52 PDT
Created attachment 250223 [details]
Patch
Comment 4 Chris Dumez 2015-04-06 13:50:31 PDT
Comment on attachment 250223 [details]
Patch

Clearing flags on attachment: 250223

Committed r182437: <http://trac.webkit.org/changeset/182437>
Comment 5 Chris Dumez 2015-04-06 13:50:35 PDT
All reviewed patches have been landed.  Closing bug.