loader(seh), hle(xasync): dispatch bad/guard-page RSP faults on a TEB emergency stack and give workers 8 MiB stacks #566
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!566
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-562"
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?
@Sheffy007 on GitHub · 2026-11-28 05:00 UTC · original
Sheffy007:fix/seh-emergency-stack-xasync-stacks→main· +185 −23 · 5 files · 1 commits · openCloses #565
Refs #395, #525
Summary
crates/victory-loader/src/native/teb.rs,seh/signal.rs,seh/context.rs):[OFF_EMERGENCY_LIMIT, OFF_EMERGENCY_BASE)) perThreadTeband frees it onDrop.on_signal(choose_dispatch_stack) so when an interrupted title fault has< 32 KiBof headroom aboveOFF_STACK_LIMIT(e.g. hitting the stack guard page) or an out-of-bounds/corruptedRSP,Context,ExceptionRecord, andentry_rspare placed at the top of the TEB's emergency stack while preserving the faultingRSPinsideContext.SIGSEGV/SIGBUSfaults in the guard region immediately belowOFF_STACK_LIMITasEXCEPTION_STACK_OVERFLOW(0xC00000FD) instead of dying silently with a nestedSIGSEGV(exit code 139) beforedispatchorunhandled_exceptioncan log.crates/victory-hle/src/modules/xasync.rs,crates/victory-gpu/src/pipeline/make.rs):XTaskQueue(xtask-serial,xtask-pool,xtask-delay),XAsync(xasync-work), andvictory-pipelines-*background threads 8 MiB stacks (8 << 20, matchinghost_posix::MIN_STACK) instead of Rust's 2 MiB default.Verification
cargo test -p victory-loader --target x86_64-apple-darwin --locked -- --test-threads=1(33 passed, including new Rosetta testguard_page_and_invalid_rsp_faults_dispatch_on_the_teb_emergency_stack)cargo test -p victory-hle --lib --target x86_64-apple-darwin xasync --locked -- --test-threads=1(13 passed)cargo test -p victory-gpu --lib pipeline:: --locked -- --test-threads=1(11 passed)cargo clippy --workspace --all-targets --all-features --locked --target x86_64-pc-windows-gnullvm -- -D warningscargo xtask policycc @Olima34
github-bot referenced this pull request2026-11-28 05:41:16 +00:00
@AnastasisKon on GitHub · 2026-11-28 17:18 UTC · original
Verified on the head
3410c883(M3 Pro, macOS 27.3, Rosetta):cargo test --target x86_64-apple-darwin -p victory-loader --lib -- --test-threads=1→ 30/30 pass, including the newguard_page_and_invalid_rsp_faults_dispatch_on_the_teb_emergency_stack; windows clippy-D warningsclean. The change itself reads well (emergency dispatch stack for guard-page/corrupt-RSP faults, stack-overflow classification, 8 MiB workers).One local concern, same class as #552: in the default parallel run the test binary itself dies with SIGSEGV (twice in a row: rc=101 after 23 tests), while
upstream/mainpasses the same command twice (rc=0). The new signal test likely races the otherseh::signaltests' handlers under Rosetta. Could it be serialized (or take a lock) the way #583 does for the Metal GPU tests? Single-threaded it's fine.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.