Merged
Conversation
utof
added a commit
to utof/perima
that referenced
this pull request
Apr 23, 2026
GH #131 documents an AB-BA lock-order inversion in SQLite's unixClose vs unixLock-from-sqlite3WalClose code paths. Per upstream forum https://sqlite.org/forum/info/a820be408ae265adb0de2b740633b179b2256420c1bb050fc9095566b18255b4 the bug was introduced in SQLite 3.51.0 (2025-11-04) by the new unixIsSharingShmNode broken-POSIX-lock detection logic, which took unixBigLock inside a scope already holding pInode->pLockMutex — violating SQLite's own documented lock-order invariant. Reported 2025-12-05, patched same day, shipped in SQLite 3.51.2 (2026-01-09). Release notes: https://sqlite.org/releaselog/3_51_2.html — "Fix an obscure deadlock in the new broken-posix-lock detection logic." rusqlite 0.38's bundled feature vendors SQLite 3.51.1 — the buggy window. rusqlite 0.39 vendors SQLite 3.51.3 with the fix. Workspace deps bumped: - rusqlite 0.38 → 0.39 - r2d2_sqlite 0.32 → 0.33 (rusqlite 0.39 transitively requires libsqlite3-sys 0.37; r2d2_sqlite 0.32 pinned 0.36 via rusqlite 0.38 → links="sqlite3" conflict; 0.33 fixes) - refinery 0.9.1 → 0.9 (relax requirement; PR branch is 0.9.0) - libsqlite3-sys 0.36 → 0.37 (transitive via rusqlite 0.39) [patch.crates-io] entry temporarily pins refinery + refinery-core to the open PR rust-db/refinery#425 branch which widens refinery's rusqlite cap from `<=0.38` to `<=0.39`. PR is mergeable + all upstream CI green; awaiting maintainer merge. Patch removal tracked in a separate follow-up issue (filed alongside this commit). Local verification (5 sequential `cargo nextest run -p perima-db` runs, default parallelism, no retries): Pre-bump: ~20% hang rate, 80s+ deadlocked test processes Post-bump: 5/5 PASS in ~8s each, 0 hangs. Workarounds added in earlier commits on this branch (nextest retries=2 for perima-db, #[ignore] on 7 desktop _inner tests, slow-timeout override for perima-desktop) are now logically dead code. They will be reverted in a follow-up commit once CI confirms this fix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.