SQLite User Forum

Assertion failure in pagerExclusiveLock function
Login

Assertion failure in pagerExclusiveLock function

(1) By Song Liu (songliu) on 2023-05-07 00:17:16 [source]

I found an assertion failure while SQLite (latest, 3f30ea5ec9d849c6) executes the following queries.

Here are the links to file test.db and test.db-wal used for reproducing the crash: test.db and test.db-wal

.open test.db
.filectrl persist_wal 2
PRAGMA journal_mode=TRUNCATE;
PRAGMA journal_mode=MEMORY;
PRAGMA journal_mode=WAL;
PRAGMA journal_mode=PERSIST;

Here are the outputs:

sqlite3-asan: sqlite3.c:63223: int pagerExclusiveLock(Pager *): Assertion `pPager->eLock==SHARED_LOCK || pPager->eLock==EXCLUSIVE_LOCK' failed.

My compilation flags:

export CFLAGS="-g -DSQLITE_DEBUG
            -DSQLITE_ENABLE_TREETRACE
            -DSQLITE_ENABLE_WHERETRACE
            -DSQLITE_ENABLE_CURSOR_HINTS
            -DSQLITE_COUNTOFVIEW_OPTIMIZATION
            -DSQLITE_ENABLE_STAT4"
./configure --enable-all --enable-debug --disable-shared && make