SQLite's internal sqlite3 struct is allocated by malloc and freed after database is closed. So any attempt to use database after it's closed results in use after free, malloc's data structures corruption, segfaults and all kind of problems. It would be nice to add some check to convert any such attempt to exceptions.
I ran into this problem when test suite (thankfully not a production) crashed occasionally. It turned out that due to race condition during cleanup it was possible to use database right after it was closed. It took a lot of time to figure out what was going on
SQLite's internal
sqlite3struct is allocated by malloc and freed after database is closed. So any attempt to use database after it's closed results in use after free, malloc's data structures corruption, segfaults and all kind of problems. It would be nice to add some check to convert any such attempt to exceptions.I ran into this problem when test suite (thankfully not a production) crashed occasionally. It turned out that due to race condition during cleanup it was possible to use database right after it was closed. It took a lot of time to figure out what was going on