Bug 158996 - ASSERT(databaseFileSize <= diskUsage) fails on storage/websql/database-lock-after-reload.html
Summary: ASSERT(databaseFileSize <= diskUsage) fails on storage/websql/database-lock-a...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-21 12:08 PDT by Alexey Proskuryakov
Modified: 2019-06-04 16:39 PDT (History)
3 users (show)

See Also:


Attachments
crash log (111.11 KB, text/plain)
2016-06-21 12:09 PDT, Alexey Proskuryakov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2016-06-21 12:08:47 PDT
Saw this assertion fail:

Thread 27 Crashed:: WebCore: Database
0   com.apple.JavaScriptCore      	0x000000010bbfe5c7 WTFCrash + 39 (Assertions.cpp:317)
1   com.apple.WebCore             	0x000000010e576895 WebCore::DatabaseTracker::getMaxSizeForDatabase(WebCore::Database const*) + 197 (DatabaseTracker.cpp:295)
2   com.apple.WebCore             	0x000000010e551d65 WebCore::Database::maximumSize() const + 37 (Database.cpp:843)
3   com.apple.WebCore             	0x00000001100c2500 WebCore::SQLTransactionBackend::openTransactionAndPreflight() + 480 (SQLTransactionBackend.cpp:570)
4   com.apple.WebCore             	0x00000001100c535f WebCore::SQLTransactionStateMachine<WebCore::SQLTransactionBackend>::runStateMachine() + 367 (SQLTransactionStateMachine.h:108)
5   com.apple.WebCore             	0x00000001100c3b52 WebCore::SQLTransactionBackend::performNextStep() + 34 (SQLTransactionBackend.cpp:516)
6   com.apple.WebCore             	0x000000010e56ce0d WebCore::DatabaseTransactionTask::doPerformTask() + 45 (DatabaseTask.cpp:171)
7   com.apple.WebCore             	0x000000010e56c99e WebCore::DatabaseTask::performTask() + 142 (DatabaseTask.cpp:89)
8   com.apple.WebCore             	0x000000010e56d98b WebCore::DatabaseThread::databaseThread() + 299 (DatabaseThread.cpp:110)
9   com.apple.WebCore             	0x000000010e56d7ed WebCore::DatabaseThread::databaseThreadStart(void*) + 29 (DatabaseThread.cpp:97)
10  com.apple.JavaScriptCore      	0x000000010bc67689 WTF::createThread(void (*)(void*), void*, char const*)::$_0::operator()() const + 25 (Threading.cpp:84)
Comment 1 Alexey Proskuryakov 2016-06-21 12:09:30 PDT
Created attachment 281767 [details]
crash log

This failure was on storage/websql/database-lock-after-reload.html, I don't know if it's test specific.
Comment 2 Alexey Proskuryakov 2016-09-26 16:00:12 PDT
This is very reproducible, 

run-webkit-tests storage/websql/database-lock-after-reload.html --repeat 10
Comment 3 Shawn Roberts 2019-06-04 16:39:02 PDT
This appears to have been happening for awhile now on iOS Simulator Debug as well and is crashing very consistantly.

Easily reproducible with:

run-webkit-tests storage/websql/database-lock-after-reload.html --debug --ios-simulator --iter 25 -f --exit-after-n-crashes=1

https://build.webkit.org/results/Apple%20iOS%2012%20Simulator%20Debug%20WK2%20(Tests)/r246079%20(4017)/storage/websql/database-lock-after-reload-stderr.txt

ERROR: SQLite database failed to set journal_mode to WAL, error: database is locked
./platform/sql/SQLiteDatabase.cpp(175) : void WebCore::SQLiteDatabase::useWALJournalMode()
ERROR: SQLite database failed to checkpoint: database is locked
./platform/sql/SQLiteDatabase.cpp(185) : void WebCore::SQLiteDatabase::useWALJournalMode()
ERROR: Unable to turn on incremental auto-vacuum (5 database is locked)
./Modules/webdatabase/Database.cpp(354) : ExceptionOr<void> WebCore::Database::performOpenAndVerify(bool)
ASSERTION FAILED: databaseFileSize <= diskUsage
./Modules/webdatabase/DatabaseTracker.cpp(280) : unsigned long long WebCore::DatabaseTracker::maximumSize(WebCore::Database &)
1   0x116358d99 WTFCrash
2   0x11ac2d0ab WTFCrashWithInfo(int, char const*, char const*, int)
3   0x11c884a47 WebCore::DatabaseTracker::maximumSize(WebCore::Database&)
4   0x11c8671b5 WebCore::Database::maximumSize()
5   0x11c8b8216 WebCore::SQLTransaction::openTransactionAndPreflight()
6   0x11c8ba6f9 WebCore::SQLTransactionBackend::openTransactionAndPreflight()
7   0x11c8b6352 WebCore::SQLTransactionStateMachine<WebCore::SQLTransactionBackend>::runStateMachine()
8   0x11c8b5fe7 WebCore::SQLTransaction::performNextStep()
9   0x11c881e8b WebCore::DatabaseTransactionTask::doPerformTask()
10  0x11c881980 WebCore::DatabaseTask::performTask()