SQLite Forum

sqlite3VdbeExec: Assertion `memIsValid(pRec)'
Login

sqlite3VdbeExec: Assertion `memIsValid(pRec)' failed

(1.2) By yongheng on 2022-12-06 22:40:38 edited from 1.1 [source]

POC:
```
sELECT DISTINCT''FROM PRAgMA_recursive_triggers()WHERE ROWID OR#s-REPLACE(0,0,0)ORDER BY 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
```

Steps to reproduce: 
./configure
make
// After I get the sqlite3.c
gcc -o harness test/ossfuzz.c test/ossshell.c sqlite3.c -ldl -pthread -DSQLITE_DEBUG
./harness poc.sql

Tested enviroment: Ubuntu 20.04, checkin: bbde0f36

(2) By Richard Hipp (drh) on 2022-12-07 00:15:53 in reply to 1.2 [link] [source]

I think there is a typo in your POC somewhere, as it does not generate a fault. However, based on this hint, I was able to find and fix a harmless problem in the code generator. So I suspect your POC is working now.

(3) By yongheng on 2022-12-07 01:14:49 in reply to 2 [link] [source]

Oh maybe there was something wrong due to the copy&paste.

Here is the original poc (https://transfer.sh/NlJBxn/poc3.sql), just for reference.

Thanks for the fix!