VFS: synchronize merged directory handle access #1405
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1415"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by hajduzsolt on 2026-11-24T15:44:07Z.
What is in it
crates/xcl/src/vfs_hooks.rs: synchronize merged-handle iteration and close; add synthetic concurrent iteration and close coverage.Tested
cargo test -p xcl --lib merged_find_serializes_iteration_and_close: 1 passed, 0 failed.cargo test --workspace -- --test-threads=4 --nocapture: 752 passed, 0 failed, 41 ignored. The reported passes include tests that return early.test_title_draws_with_a_root_signature_under_the_debug_layeranduploads_start_from_each_subresources_state(D3D12 debug layer unavailable).Regression run
main:
PR:
Not tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T17:13:08Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (One parallel run showed a single flaky failure; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
upstream-sync referenced this pull request2026-11-25 06:04:27 +00:00
upstream-sync referenced this pull request2026-11-25 11:07:09 +00:00
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-27T21:26:27Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:40:14Z.
Triage (#1607) – head
cd47fe2#1662 fixes the same MergedFind use-after-free in vfs_hooks.rs (#1388) differently: the MERGED map owns the entries under synthetic handles, plus null-pointer checks. This PR was opened first, merges cleanly and has a concurrency test; it keeps the boxed handles and does the lookup, iteration and free under the one MERGED lock.
Minor: merged_next/close_merged use MERGED.lock().unwrap() inside extern "system" hooks, so a poisoned lock aborts where the old code fell through; the test module now has two 'use super::*;' lines and the diff leaves a double blank line.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-03T09:14:51Z.
merge-check
base:
16c2fd082ahead:
cd47fe2c8emerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3013 passed, 0 failed, 56 ignored (base: 3012 passed, 0 failed, 56 ignored, counted on
395405e4; only docs and scripts changed since); SKIPPED: 25, the same as base (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps); failing: nonereview: read the whole diff (1 file, +67 -18). No blocking finding.
merged_nextlooks the handle up, reads the entry and moves the position under oneMERGEDlock, andclose_mergedremoves and frees under the same lock. The entry is copied out, so the caller's buffer is written after the lock is released.vfstests passed 40 of 40 at 8 threads.MERGED.lock().unwrap()in the two helpers would end the process on a poisoned lock, where main's code went on to the real function (also in the triage comment above). Nothing inside the two locked sections is expected to panic.is_mergedwas, and the test sits above the module'suse super::*;with its own copy of it.dwSizechecks of #1388 (point 2) are not in this PR, as its description says, so the issue should stay open after the merge. #1662, the other PR for this bug, is closed.performance: none expected:
FindNextFileon a merged listing took this lock once before and takes it once now, held for one entry copy.verdict: safe to merge
hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.