SQLite Forum

Assertion failure in do_meta_command function
Login

Assertion failure in do_meta_command function

(1) By Song Liu (songliu) on 2023-04-20 18:37:04 [source]

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

PRAGMA hard_heap_limit=90000;
ATTACH '' AS 0;
.sha3

Here are the outputs:

90000
sqlite3: shell.c:25625: int do_meta_command(char *, ShellState *): Assertion `lrc==SQLITE_OK' failed.
[1]    3962320 abort (core dumped)  ./sqlite3 < poc

Here is the result of bisecting:

 12 BAD     2022-12-06 19:32:07 bbde0f36d03cdbbc
 13 GOOD    2022-12-06 19:20:49 03ae8680e430c6d2 CURRENT

My compilation flags:

export CFLAGS="-g -DSQLITE_DEBUG" 

(2) By Larry Brasfield (larrybr) on 2023-04-20 20:25:20 in reply to 1 [link] [source]

Thanks. This has been fixed.

There may be a few more like this for a short while. The CLI has not undergone low-memory stress testing due to its more limited purposes compared to the SQLite library. So your emulation of low memory has, unsurprisingly, shown that calls which normally cannot fail are nevertheless susceptible to OOM problems that we do not expect to ever see in normal CLI usage.

(3) By Song Liu (songliu) on 2023-04-20 22:27:39 in reply to 2 [link] [source]

Thanks for your detailed explanation and efforts!