Skip to content

ASSERTION FAILED: checkedPtrCountWithoutThreadCheck() in SQLiteStorageArea:: createAndPopulateInitialDatabaseInfo#52579

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
szewai:eng/ASSERTION-FAILED-checkedPtrCountWithoutThreadCheck-in-SQLiteStorageArea-createAndPopulateInitialDatabaseInfo
Oct 18, 2025
Merged

ASSERTION FAILED: checkedPtrCountWithoutThreadCheck() in SQLiteStorageArea:: createAndPopulateInitialDatabaseInfo#52579
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
szewai:eng/ASSERTION-FAILED-checkedPtrCountWithoutThreadCheck-in-SQLiteStorageArea-createAndPopulateInitialDatabaseInfo

Conversation

@szewai
Copy link
Contributor

@szewai szewai commented Oct 17, 2025

8414bf0

ASSERTION FAILED: checkedPtrCountWithoutThreadCheck() in SQLiteStorageArea:: createAndPopulateInitialDatabaseInfo
rdar://162891393
https://bugs.webkit.org/show_bug.cgi?id=301007

Reviewed by Per Arne Vollan and Chris Dumez.

I got the assertion faliure when running API test IndexedDB.IndexedDBFileHashCollision on debug build. The cause is that
SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo sets m_database to null (with closeSQLiteDB after
m_database is captured in a local CheckedPtr variable sqliteDB. When the CheckedPtr variable is destroyed at function
exit, the assertion will be hit as the SQLiteDatabase object is already gone.

To fix this, avoid resetting m_database by removing closeSQLiteDB() calls in createAndPopulateInitialDatabaseInfo. This
is viable because the only caller of createAndPopulateInitialDatabaseInfo (i.e. getOrEstablishDatabaseInfo) will invoke
closeSQLiteDB when createAndPopulateInitialDatabaseInfo returns nullptr.

* Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo):

Canonical link: https://commits.webkit.org/301758@main

6067fed

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win ✅ 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ❌ 🧪 win-tests ⏳ 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ❌ 🧪 api-wpe ✅ 🛠 vision-apple
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@szewai szewai self-assigned this Oct 17, 2025
@szewai szewai marked this pull request as ready for review October 18, 2025 00:55
@szewai szewai requested review from cdumez, pvollan and rniwa October 18, 2025 00:55
@szewai szewai added the merge-queue Applied to send a pull request to merge-queue label Oct 18, 2025
…eArea:: createAndPopulateInitialDatabaseInfo

rdar://162891393
https://bugs.webkit.org/show_bug.cgi?id=301007

Reviewed by Per Arne Vollan and Chris Dumez.

I got the assertion faliure when running API test IndexedDB.IndexedDBFileHashCollision on debug build. The cause is that
SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo sets m_database to null (with closeSQLiteDB after
m_database is captured in a local CheckedPtr variable sqliteDB. When the CheckedPtr variable is destroyed at function
exit, the assertion will be hit as the SQLiteDatabase object is already gone.

To fix this, avoid resetting m_database by removing closeSQLiteDB() calls in createAndPopulateInitialDatabaseInfo. This
is viable because the only caller of createAndPopulateInitialDatabaseInfo (i.e. getOrEstablishDatabaseInfo) will invoke
closeSQLiteDB when createAndPopulateInitialDatabaseInfo returns nullptr.

* Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo):

Canonical link: https://commits.webkit.org/301758@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/ASSERTION-FAILED-checkedPtrCountWithoutThreadCheck-in-SQLiteStorageArea-createAndPopulateInitialDatabaseInfo branch from 6067fed to 8414bf0 Compare October 18, 2025 03:42
@webkit-commit-queue
Copy link
Collaborator

Committed 301758@main (8414bf0): https://commits.webkit.org/301758@main

Reviewed commits have been landed. Closing PR #52579 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 8414bf0 into WebKit:main Oct 18, 2025
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Oct 18, 2025
@szewai szewai deleted the eng/ASSERTION-FAILED-checkedPtrCountWithoutThreadCheck-in-SQLiteStorageArea-createAndPopulateInitialDatabaseInfo branch January 2, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants