Repository navigation
Fix a process abort when several large files are read at once - #56
Merged
Merged
Conversation
decrypt_range borrowed the per-thread ciphertext buffer and held the borrow across pool().install. While a pool thread waits for its chunks there it runs other jobs, including another file's read-ahead, which re-entered decrypt_range on the same thread: "RefCell already borrowed", and a panic inside rayon::spawn aborts the whole process (0xc0000409, seen in CI). The buffer is now taken out of the thread for the call and put back after, and the read-ahead job catches panics and falls back to a normal read. New test reads 8 files in parallel; it aborted 5 of 5 runs before the fix and passes 8 of 8 after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
zamok-core could abort (0xc0000409) when two or more large files were read at the same time: the read-ahead job re-entered
decrypt_rangeon a pool thread that already held the thread-local ciphertext buffer, panicked with "RefCell already borrowed", and a panic inrayon::spawnaborts the process. This is the intermittentzamok-fs --libCI failure.parallel_large_reads_of_many_files_do_not_crash: aborted 5/5 before, passes 8/8 after.cargo fmt, clippy, cargo test workspace, tests/fs/test-fs.ps1 33/33.
🤖 Generated with Claude Code