diff --git a/Cargo.toml b/Cargo.toml index 2fe82a3..72b52b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,8 @@ map-unwrap-or = "warn" rusqlite = { version = "=0.38.0", features = ["blob", "trace", "bundled"] } log = { version = "=0.4.29", features = ["std"] } parking_lot = "=0.12.5" +libc = "0.2" +tempfile = "3" [build-dependencies] bindgen = { version = "0.72", default-features = false } diff --git a/src/vfs.rs b/src/vfs.rs index 4b94ab9..802c609 100644 --- a/src/vfs.rs +++ b/src/vfs.rs @@ -313,7 +313,11 @@ fn register_inner( } let io_methods = ffi::sqlite3_io_methods { - iVersion: 3, + // iVersion 2 = SHM/WAL support (xShmMap through xShmUnmap). + // iVersion 3 requires xFetch/xUnfetch to be non-null, but they are + // currently None. Setting 3 with null xFetch causes SEGFAULT when + // SQLite calls xFetch during WAL checkpoint under concurrent load. + iVersion: 2, xClose: Some(x_close::), xRead: Some(x_read::), xWrite: Some(x_write::),