runtime: Apps with CET support enabled do not launch
Description
I’ve recently updated a .NET app I had to a newer version and found out that it doesn’t launch. Fast forward 2 days, I tracked down the issue to the fact that the app was upgraded from .NET 8.0 to 9.0, and testing in multiple configurations on my local machine revealed that any .NET 9.0 app simply doesn’t work on my machine, unless I explicitly add <CETCompat>false</CETCompat> to the .csproj file.
Debugger is entirely useless as it only shows this:
The program '[XXX] XXX.exe' has exited with code 3221227010 (0xc0000602) 'The process aborted due to a fail fast exception.'.
If I create a console application instead, I also get this right above the aforementioned crash:
CLR: Assert failure(PID 4452 [0x00001164], Thread: 20648 [0x50a8]): !AreShadowStacksEnabled() || UseSpecialUserModeApc()
File: D:\a\_work\1\s\src\coreclr\vm\threads.cpp:7938
That led me to #108589, where someone else had the same assert and updating their Windows helped, but they updated to the exact same build I am running from 2023, so I hardly believe this to be an issue.
Reproduction Steps
…
Expected behavior
…
Actual behavior
…
Regression?
There was no crash until CET support was forced on by default
Known Workarounds
Disabling CET support on a per-app basis
Configuration
.NET 9.0.0 Windows 10 Pro 22H2 x64 build 19045.2965, Windows Feature Experience Pack 1000.19041.1000.0
Other information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 17 (14 by maintainers)
If you are on (fully patched) supported Windows version, you should not encounter this problem.
If you need your app to run on unsupported Windows versions (this includes Windows installations that are not fully patches), you may encounter this problem. Publishing your app with CET disabled is workaround in that case.
24H2 is Win11 version number. Win11 has the required fixed. You should not see this problem on 24H2.
I am not sure how we would do that. The CET enable/disable flag is in the .exe. Once the .exe starts executing, the CET state cannot be changed.
Windows CET fixes shipped in summer 2022 and they were backported to multiple Windows OS release trains that were supported at that time. I do not have an easy way to find all exact ntdll.dll version numbers that have the fixes.