VICTORY_STACKS can nest Wine's SIGUSR1 exception handler while sampling #62

Open
opened 2026-12-01 09:10:34 +00:00 by github-bot · 1 comment
Owner

@⁠TheRifai on GitHub · 2026-12-01 09:09 UTC · original

Finding (AGENTS.md rules 21, 29)

VICTORY_STACKS (crates/victory-loader/src/stacks.rs) suspends each thread with SuspendThread to read its context. Under Wine, SuspendThread is delivered with SIGUSR1 and handled in ntdll.so's usr1_handler.

During the exit-1 investigation, a filtered run with VICTORY_STACKS=12,15,... produced, immediately before the exit:

00ec:err:virtual:virtual_setup_exception nested exception on signal stack addr 0x7f22b4f64184 stack 0x7ff9ef60

Mapping the fault PC through Proton's ntdll.so put it at offset 0x4f184, inside usr1_handler (symbol starts at 0x4f0b0). A later identical filtered run without VICTORY_STACKS had no such exception and survived. So this looks like a diagnostic artifact, not the title fault — but it means the stack sampler can perturb Wine's signal handling, which is exactly when someone would use it to debug a crash.

Next

Note the limitation in docs/tools.md where VICTORY_STACKS is catalogued, and consider a less intrusive sampling method (e.g., NtGetContextThread on a thread that is already waiting, or Wine-side thread contexts) so the tool does not need SIGUSR1. No change to the game code is implied.

Seen on: f4dc80f-era builds with GE-Proton11-15.

**@⁠TheRifai** on GitHub · 2026-12-01 09:09 UTC · [original](https://github.com/vktory6/VKtory/issues/62) ## Finding (AGENTS.md rules 21, 29) `VICTORY_STACKS` (`crates/victory-loader/src/stacks.rs`) suspends each thread with `SuspendThread` to read its context. Under Wine, `SuspendThread` is delivered with SIGUSR1 and handled in `ntdll.so`'s `usr1_handler`. During the exit-1 investigation, a filtered run with `VICTORY_STACKS=12,15,...` produced, immediately before the exit: ``` 00ec:err:virtual:virtual_setup_exception nested exception on signal stack addr 0x7f22b4f64184 stack 0x7ff9ef60 ``` Mapping the fault PC through Proton's `ntdll.so` put it at offset `0x4f184`, inside `usr1_handler` (symbol starts at `0x4f0b0`). A later identical filtered run **without** `VICTORY_STACKS` had no such exception and survived. So this looks like a diagnostic artifact, not the title fault — but it means the stack sampler can perturb Wine's signal handling, which is exactly when someone would use it to debug a crash. ## Next Note the limitation in `docs/tools.md` where `VICTORY_STACKS` is catalogued, and consider a less intrusive sampling method (e.g., `NtGetContextThread` on a thread that is already waiting, or Wine-side thread contexts) so the tool does not need SIGUSR1. No change to the game code is implied. Seen on: `f4dc80f`-era builds with GE-Proton11-15.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 09:10:34 +00:00
Author
Owner

@⁠vktory6 on GitHub · 2026-12-01 09:15 UTC · original

Thanks! VICTORY_STACKS now has an entry in docs/tools.md with this limit: a fault right after a sample is suspect, so repeat without it before reading it as the title's (github.com/vktory6/VKtory@e6de2b1). A sampler that does not need SIGUSR1 can come when someone needs it.

**@⁠vktory6** on GitHub · 2026-12-01 09:15 UTC · [original](https://github.com/vktory6/VKtory/issues/62#issuecomment-7306439323) Thanks! `VICTORY_STACKS` now has an entry in `docs/tools.md` with this limit: a fault right after a sample is suspect, so repeat without it before reading it as the title's (https://github.com/vktory6/VKtory/commit/e6de2b1). A sampler that does not need SIGUSR1 can come when someone needs it.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/vktory6--VKtory#62
No description provided.