RESOLVED FIXED 36473
Missing lock in call to doneCreatingDatabase
https://bugs.webkit.org/show_bug.cgi?id=36473
Summary Missing lock in call to doneCreatingDatabase
Eric U.
Reported 2010-03-22 18:20:39 PDT
The last call to doneCreatingDatabase in DatabaseTracker::canEstablishDatabase is called without locking m_databaseGuard. This will assert in debug builds and use a supposedly-protected data structure without locking in release builds. This is a bug in my last checkin [56293]. This wasn't caught by layout tests because we don't have one that tries to create a database with a large quota.
Attachments
Patch (1.76 KB, patch)
2010-03-22 18:51 PDT, Eric U.
no flags
Patch (3.07 KB, patch)
2010-03-25 10:47 PDT, Eric U.
no flags
Patch (3.46 KB, patch)
2010-03-25 15:13 PDT, Eric U.
no flags
Eric U.
Comment 1 2010-03-22 18:51:53 PDT
Dumitru Daniliuc
Comment 2 2010-03-22 19:01:40 PDT
LGTM, fwiw.
Eric Seidel (no email)
Comment 3 2010-03-25 00:28:14 PDT
Comment on attachment 51382 [details] Patch The test seems missing from this patch.
Eric U.
Comment 4 2010-03-25 10:47:31 PDT
Eric U.
Comment 5 2010-03-25 10:48:03 PDT
Thanks Eric; forgot the svn add.
David Levin
Comment 6 2010-03-25 14:51:45 PDT
Comment on attachment 51656 [details] Patch > Index: WebCore/ChangeLog > + * storage/DatabaseTracker.cpp: Added missing lock call. Ideally your comment would be at the function level (which is where you did this change). > + (WebCore::DatabaseTracker::canEstablishDatabase): > + > Index: WebCore/storage/DatabaseTracker.cpp > + MutexLocker lockDatabase(m_databaseGuard); > doneCreatingDatabase(origin, name); It seems nicer to do this: MutexLocker lockDatabase(m_databaseGuard); if (requirement <= quotaForOriginNoLock(origin)) return true; doneCreatingDatabase(origin, name); Opinion?
Eric U.
Comment 7 2010-03-25 15:13:15 PDT
(In reply to comment #6) > (From update of attachment 51656 [details]) > > Index: WebCore/ChangeLog > > + * storage/DatabaseTracker.cpp: Added missing lock call. > > Ideally your comment would be at the function level (which is where you did > this change). > > > + (WebCore::DatabaseTracker::canEstablishDatabase): > > + Fixed. > > Index: WebCore/storage/DatabaseTracker.cpp > > + MutexLocker lockDatabase(m_databaseGuard); > > doneCreatingDatabase(origin, name); > > It seems nicer to do this: > > MutexLocker lockDatabase(m_databaseGuard); > if (requirement <= quotaForOriginNoLock(origin)) > return true; > > doneCreatingDatabase(origin, name); > > Opinion? Sure, and I'll do you one better; I can let the previous lock call out of its braces.
Eric U.
Comment 8 2010-03-25 15:13:57 PDT
WebKit Commit Bot
Comment 9 2010-03-25 20:22:20 PDT
Comment on attachment 51682 [details] Patch Rejecting patch 51682 from commit-queue. Unexpected failure when landing patch! Please file a bug against webkit-patch. Failed to run "['WebKitTools/Scripts/webkit-patch', '--status-host=webkit-commit-queue.appspot.com', 'land-attachment', '--force-clean', '--non-interactive', '--parent-command=commit-queue', '--build-style=both', '--quiet', '51682', '--no-update']" exit_code: 1 Last 500 characters of output: ne 60, in _run step(tool, options).run(state) File "/Users/eseidel/Projects/CommitQueue/WebKitTools/Scripts/webkitpy/tool/steps/commit.py", line 34, in run commit_message = self._tool.checkout().commit_message_for_this_commit() File "/Users/eseidel/Projects/CommitQueue/WebKitTools/Scripts/webkitpy/common/checkout/api.py", line 65, in commit_message_for_this_commit return CommitMessage("".join(changelog_messages).splitlines()) NameError: global name 'CommitMessage' is not defined
Eric Seidel (no email)
Comment 10 2010-03-25 21:18:36 PDT
Comment on attachment 51682 [details] Patch I've restarted the commit-bot. Sorry for the noise.
WebKit Commit Bot
Comment 11 2010-03-25 23:06:24 PDT
Comment on attachment 51682 [details] Patch Clearing flags on attachment: 51682 Committed r56604: <http://trac.webkit.org/changeset/56604>
WebKit Commit Bot
Comment 12 2010-03-25 23:06:28 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.