fix(windows): the launcher is not marked CET compatible, so an overlay's DLL in it cannot make Windows end it with no log #229
No reviewers
Labels
No labels
area/build
area/install
area/saves
area/tooling
area/ui
area/updates
ci: approved
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!229
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/LongshotLauncher:fix/cet-compat-off"
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?
The launcher can be closed outright by Windows, with no log and no message, when an overlay or capture tool's DLL inside it trips the hardware stack protection (CET) that .NET 10 turns on for every program by default. #116's crash dump shows exactly that, and #152's start-up abort with "Unknown Hard Error" and no logs may be the same thing.
Summary
App/LongshotLauncher.csproj:<CETCompat>false</CETCompat>. Since .NET 9 the SDK marks the program CET compatible by default. With that mark on a CPU that has shadow stacks (both reporters have Zen 3: a 5600X and a 5800X), Windows fast-fails the process (FAST_FAIL_SET_CONTEXT_DENIED,0xC0000409subcode0x30) when code inside it sets a thread's context outside the shadow stack while an exception unwinds. That is #116's stack:clr!IL_Throw,RaiseException,RtlUnwindEx,ProcessCLRException,RcContinueExit, with OBS'sgraphics-hook64.dlland NVIDIA'snvspcap64.dllloaded. The process dies before theUnhandledExceptionhandler (#171) can write anything, so the log has nothing. With the mark off, the exception unwinds normally: either it is caught, or the existing crash log records it.tests/test_launcher_core.py:check_cet_compat_offreads the csproj, so the setting can't be dropped without the tests failing.Not claimed: that this fixes #152. Its reporter ran rc.9, which predates the start-up crash log (#171, in rc.10), and an early Windows 10 21H1 build (19043.928) on a CET-capable CPU fits the same cause, but there is no dump to confirm it. If it still happens on a build with this change, the crash log from #171 should now have the exception.
Refs #116
Refs #152
Testing
scripts/package.shdoes (-r win-x64 --self-contained -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true), with cleanobj/, and read the PE's extended DLL characteristics (debug directory entry type 20):0x1(CET_COMPAT), inherited from the .NET 10singlefilehost.exe0x0python -I tests/test_launcher_core.py: passes (2599 checks).LAUNCHER=$PWD python -I ../Tooling/tests/test_release.py: 3 failures (test_the_bump,test_the_next_stable,test_check_tag_against_the_published_releases). Unchanged main fails the same 3, and this change touches nothingrelease.pyreads.🤖 Generated with Claude Code