Closed rogerbinns closed 5 months ago
It was this commit re-enabling sqlicipher that made the assertion failure start happening.
I will look into this.
It was this commit re-enabling sqlicipher that made the assertion failure start happening.
I made a quick test. IMHO the problem has nothing to do with SQLCipher. The reason must be something else. The test crashes already on setting the invalid hexkey. Other tests like the backup test still succeed.
So, something seems to go wrong on applying a key for the second time. At the moment I don't know yet, why.
I used cvise to reduce it. The first user_version
pragma is cricitcal, and the second is when the assertion fails.
import apsw
db = apsw.Connection("mcdb")
db.pragma("user_version", "")
db.pragma("hexkey", "1122")
db.pragma("user_version", "")
I used cvise to reduce it. The first
user_version
pragma is cricitcal, and the second is when the assertion fails.import apsw db = apsw.Connection("mcdb") db.pragma("user_version", "") db.pragma("hexkey", "1122") db.pragma("user_version", "")
Thanks. That shows that the SQLCipher configuration is most likely not involved.
AFAICT SQLite deals with the assertion situation correctly later on. For example, the release version of the SQLite shell works as expected and doesn't show any misbehaviour. Of course, this is no excuse for an obvious bug, and it will be fixed. It just will take some time.
After some hours of debugging I think I found the reason for the assertion. Internally the wrong key was correctly detected, but it was not properly communicated to upper level functions. Actually, the error is detected later in SQLite, but in debug mode the assertion is raised first.
Commit https://github.com/utelle/apsw-sqlite3mc/commit/ca146ddc910368afda052f4d73e2bd1f101d2e9d includes an updated amalgamation. Hopefully all tests will now run as expected.
Build apsw-sqlite3mc with --debug so assertions are enabled.