The parent opens the DB, forks a child that then also opens the DB. Perhaps SQLite3 builds state that is not fork-safe in the process? Changing the test to fork and only then open DB in the parent and child (and also fixing a couple of bugs along the way) solved the problem. Thanks!