Bug 35624 - Closing a database while a transaction is in progress can cause a crash
Summary: Closing a database while a transaction is in progress can cause a crash
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Dumitru Daniliuc
Depends on:
Reported: 2010-03-02 18:06 PST by Dumitru Daniliuc
Modified: 2010-03-03 17:02 PST (History)
1 user (show)

See Also:

patch (1.35 KB, patch)
2010-03-02 18:40 PST, Dumitru Daniliuc
dglazkov: review+
dumi: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
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]

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.