Bug 35624

Summary: Closing a database while a transaction is in progress can cause a crash
Product: WebKit Reporter: Dumitru Daniliuc <dumi>
Component: New BugsAssignee: Dumitru Daniliuc <dumi>
Status: RESOLVED FIXED    
Severity: Normal CC: michaeln
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
patch dglazkov: review+, dumi: commit-queue-

Description Dumitru Daniliuc 2010-03-02 18:06:50 PST
Before running any transaction step on the DB thread or the main thread, we check if the database is closed by calling the SQLTransaction::checkAndHandleClosedDatabase() method. Parts of that method though are intended to run only on the DB thread, and could cause a crash if run on the main thread. In particular, calling SQLTransactionCoordinator::releaseLock() on the main thread after SQLTransactionCoordinator::shutdown() was called on the DB thread triggers an assertion failure.

Solution: check what thread we're on inside SQLTransaction::checkAndHandleClosedDatabase() and only run the appropriate code for that thread.
Comment 1 Dumitru Daniliuc 2010-03-02 18:40:48 PST
Created attachment 49874 [details]
patch
Comment 2 Michael Nordman 2010-03-02 18:52:13 PST
yup... lgtm
Comment 3 Dimitri Glazkov (Google) 2010-03-03 13:11:18 PST
Comment on attachment 49874 [details]
patch

Per our IM discussion, please describe why it's impossible to write a deterministic regression test for it and mention the flakiness in the layout test it fixes.
Comment 4 Dumitru Daniliuc 2010-03-03 17:02:29 PST
Landed as r55487.