0

I'm encountering a runtime assertion failure when trying to execute a SQLite query using sqlite3_exec in Xcode 26. The error occurs specifically when attempting to set WAL (Write-Ahead Logging) mode and other database configurations.

Here is the code snippet that causes the problem:

NSString *sql = @"pragma journal_mode = wal; pragma synchronous = normal; create table if not exists manifest (key text, filename text, size integer, inline_data blob, modification_time integer, last_access_time integer, extended_data blob, primary key(key)); create index if not exists last_access_time_idx on manifest(last_access_time);";
char *error = NULL;
sqlite3_exec(_db, sql.UTF8String, NULL, NULL, &error);

When this code executes, it triggers the following assertion failure:

An abort signal terminated the process. Such crashes often happen because of an uncaught exception or unrecoverable error or calling the abort() function.

Assertion failed: (0), function checkWalModeFromQuery, file SQLiteDatabaseTracking.cpp, line 942.

I tried disabling WAL mode, but it doesn’t seem to take effect. I removed pragma journal_mode = wal; pragma synchronous = normal;

1
  • In my own app I’m setting the journal mode to WAL and it works fine under iOS 26. In my case I create the database file first. I then run a separate sqlite_exec for the pragma. Give that a try and see if it works for you. Commented Sep 22 at 16:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.