Forget the views a test unmaps in drop_views #382

Open
github-bot wants to merge 1 commit from github-bot/gh-382 into main AGit
Owner

@⁠hamdanpor-ctrl on GitHub · 2026-11-27 21:36 UTC · original
hamdanpor-ctrl:fix/drop-views-forgets-views → main · +3 −1 · 1 files · 1 commits · open

Addresses #354.

drop_views told the guard of each view with title_memory_remapped and then unmapped it, so VIEWS kept those blocks as views. A later test that got the same addresses from VirtualAlloc for private, write-watched memory then had its range refused by ask_once (refused_as_view), nothing was kept, and asked() / prepare_raw_copy_note() answered None.

drop_views now calls title_memory_unmapping before unmapping, as the runtime and the other unmapping tests do, which forgets the views. One line, tests only.

How it was found: with a temporary eprintln! in ask_rest (not in this PR), every one of 8 failures of the two raw-copy tests on 1d83085 showed the test's fresh allocation skipped with published=false view=true.

cargo test -p victory-gpu --locked, parallel Runs Failed
1d83085 50 30 (raw-copy tests)
1d83085 + this change 10 1 (raw_title_copy_keeps_write_watch_and_resends_equal_bytes)
main at 2d97073 10 1
this branch on 0148258 40 0 (527 passed each)

So most of it is this; the one remaining failure on 1d83085 suggests a second, rarer source I have not found. Clippy with and without --all-features is clean, and cargo test -p victory-gpu --all-features --locked -- --test-threads=1 passes.

RTX 3050 Laptop GPU 4 GB (driver 617.42), i7-12700H, 16 GB, Windows 11 Pro, Rust 1.98.1.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

**@⁠hamdanpor-ctrl** on GitHub · 2026-11-27 21:36 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/382) `hamdanpor-ctrl:fix/drop-views-forgets-views` → `main` · +3 −1 · 1 files · 1 commits · open Addresses #354. `drop_views` told the guard of each view with `title_memory_remapped` and then unmapped it, so `VIEWS` kept those blocks as views. A later test that got the same addresses from `VirtualAlloc` for private, write-watched memory then had its range refused by `ask_once` (`refused_as_view`), nothing was kept, and `asked()` / `prepare_raw_copy_note()` answered `None`. `drop_views` now calls `title_memory_unmapping` before unmapping, as the runtime and the other unmapping tests do, which forgets the views. One line, tests only. How it was found: with a temporary `eprintln!` in `ask_rest` (not in this PR), every one of 8 failures of the two raw-copy tests on `1d83085` showed the test's fresh allocation skipped with `published=false view=true`. | `cargo test -p victory-gpu --locked`, parallel | Runs | Failed | |---|---:|---:| | `1d83085` | 50 | 30 (raw-copy tests) | | `1d83085` + this change | 10 | 1 (`raw_title_copy_keeps_write_watch_and_resends_equal_bytes`) | | `main` at `2d97073` | 10 | 1 | | this branch on `0148258` | 40 | 0 (527 passed each) | So most of it is this; the one remaining failure on `1d83085` suggests a second, rarer source I have not found. Clippy with and without `--all-features` is clean, and `cargo test -p victory-gpu --all-features --locked -- --test-threads=1` passes. RTX 3050 Laptop GPU 4 GB (driver 617.42), i7-12700H, 16 GB, Windows 11 Pro, Rust 1.98.1. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
drop_views told the guard of each view with title_memory_remapped and then
unmapped it, so VIEWS kept the blocks as views. A test that later got the
same addresses from VirtualAlloc for private, write-watched memory had
its range refused as a view by ask_once (refused_as_view), nothing was
kept, and asked() or prepare_raw_copy_note() answered None (#354).

drop_views now calls title_memory_unmapping before unmapping, as the
runtime and the other tests do, which forgets the views.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 21:38:32 +00:00
Author
Owner

@⁠hamdanpor-ctrl on GitHub · 2026-11-27 21:57 UTC · original

More runs on 1d83085 with this change applied (cargo test -p victory-gpu --locked, parallel): 2 failures in 50 runs in total (1 of 10, 1 of 20, 0 of 20), against 30 of 50 without it.

The one leftover failure I could catch was raw_title_copy_keeps_write_watch_and_resends_equal_bytes with its range skipped as a view as well (VIEWS set, PROTECTED not), so some other path still leaves a VIEWS bit on freed memory, much more rarely. A probe recording which thread sets VIEWS in guard() changed the timing enough that it did not fail in 20 runs, so I don't have its source yet.

AI-assisted (Claude Code).

**@⁠hamdanpor-ctrl** on GitHub · 2026-11-27 21:57 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/382#issuecomment-7228906438) More runs on `1d83085` with this change applied (`cargo test -p victory-gpu --locked`, parallel): 2 failures in 50 runs in total (1 of 10, 1 of 20, 0 of 20), against 30 of 50 without it. The one leftover failure I could catch was `raw_title_copy_keeps_write_watch_and_resends_equal_bytes` with its range skipped as a view as well (`VIEWS` set, `PROTECTED` not), so some other path still leaves a `VIEWS` bit on freed memory, much more rarely. A probe recording which thread sets `VIEWS` in `guard()` changed the timing enough that it did not fail in 20 runs, so I don't have its source yet. AI-assisted (Claude Code).
Author
Owner

@⁠hamdanpor-ctrl on GitHub · 2026-11-27 21:58 UTC · original

The failing default-tests job is host::refresh_tests::unchanged_ranges_are_known (host.rs:13136, "view false: written at its end"). It holds one_asking_test(), and its view = false half uses fresh private write-watched memory from title(8 * PAGE, false), the same situation as the two raw-copy tests, so it looks like the rarer leftover I mentioned above (a VIEWS bit still set on a reused address) rather than something this change adds. This branch passed it in all 40 parallel runs of cargo test -p victory-gpu --locked here, and the diagnostics job passed. Could you re-run the failed jobs?

AI-assisted (Claude Code).

**@⁠hamdanpor-ctrl** on GitHub · 2026-11-27 21:58 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/382#issuecomment-7228917657) The failing default-tests job is `host::refresh_tests::unchanged_ranges_are_known` (`host.rs:13136`, "view false: written at its end"). It holds `one_asking_test()`, and its `view = false` half uses fresh private write-watched memory from `title(8 * PAGE, false)`, the same situation as the two raw-copy tests, so it looks like the rarer leftover I mentioned above (a `VIEWS` bit still set on a reused address) rather than something this change adds. This branch passed it in all 40 parallel runs of `cargo test -p victory-gpu --locked` here, and the diagnostics job passed. Could you re-run the failed jobs? AI-assisted (Claude Code).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/382/head:github-bot/gh-382'
git switch 'github-bot/gh-382'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-382'
git switch 'github-bot/gh-382'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-382'
git switch 'github-bot/gh-382'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-382'
git switch 'main'
git merge --squash 'github-bot/gh-382'
git switch 'main'
git merge --ff-only 'github-bot/gh-382'
git switch 'main'
git merge 'github-bot/gh-382'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.