Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet run error Assert failure(PID 28188 [0x00006e1c], Thread: 26664 [0x6828]) in .net 9 #110000

Open
mammadkoma opened this issue Nov 20, 2024 · 12 comments
Labels
area-VM-coreclr untriaged New issue has not been triaged by the area owner

Comments

@mammadkoma
Copy link

mammadkoma commented Nov 20, 2024

Description

I create a web api .net 9 project, it builds but after running dotnet run command it shows error. I don't have any problem in .net 8 on Windows 10.
The commands in .net 9 :
PS D:\TestProjects\WebApi> dotnet build
Restore complete (0.2s)
WebApi succeeded (2.4s) → bin\Debug\net9.0\WebApi.dll

Build succeeded in 3.0s
PS D:\TestProjects\WebApi> dotnet run
Using launch settings from D:\TestProjects\WebApi\Properties\launchSettings.json...
Building...
CLR: Assert failure(PID 28188 [0x00006e1c], Thread: 26664 [0x6828]): !AreShadowStacksEnabled() || UseSpecialUserModeApc()
File: D:\a_work\1\s\src\coreclr\vm\threads.cpp:7938 Image:
D:\TestProjects\WebApi\bin\Debug\net9.0\WebApi.exe
PS D:\TestProjects\WebApi>

Reproduction Steps

create a web api in .net 9

Expected behavior

running the project

Actual behavior

getting error

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Nov 20, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Nov 20, 2024
@huoyaoyuan huoyaoyuan added area-VM-coreclr and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Nov 20, 2024
Copy link
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

@mangod9
Copy link
Member

mangod9 commented Nov 20, 2024

@mammadkoma this looks related to CET. Are you able to reproduce the failure on different machines? Can you try to disable CET and check if the problem persists: https://learn.microsoft.com/en-us/dotnet/core/compatibility/interop/9.0/cet-support

@mammadkoma
Copy link
Author

mammadkoma commented Nov 24, 2024

It runs after adding this line to the .csproj file :
<CETCompat>false</CETCompat>

So why should I add this line for .net 9 ?

@mangod9
Copy link
Member

mangod9 commented Nov 25, 2024

are you able to share a repro? Is this a simple webapi project created with dotnet new webapi ?

@mammadkoma
Copy link
Author

mammadkoma commented Nov 28, 2024

Yes I created by dotnet new webapi command. It has this problem in other project types for example blazor webapp.

@JustArchi
Copy link
Contributor

Also got user of my OSS app running into the same issue: JustArchiNET/ArchiSteamFarm#3348

Can't provide much more details on their environment, but the app definitely doesn't start now after .NET 9 upgrade.

CLR: Assert failure(PID 10336 [0x00002860], Thread: 9268 [0x2434]): !AreShadowStacksEnabled() || UseSpecialUserModeApc()
File: D:\a_work\1\s\src\coreclr\vm\threads.cpp:7938 Image:
D:\program\ASF-win-x64\ArchiSteamFarm.exe

@mangod9
Copy link
Member

mangod9 commented Dec 2, 2024

@janvorli FYI. Can they provide details on the hardware they are running on. Also weird that the assert is showing up here. Any repro and/or dumps if available would be helpful to diagnose.

So why should I add this line for .net 9 ?

in .NET 9 CET compat-mode is enabled by default, so if the hardware is capable CET would be enabled. It appears there are specific cases where it isnt quite working right.

@janvorli
Copy link
Member

janvorli commented Dec 2, 2024

This means that the Windows are out of date quite a lot and so they don't contain the fix for a bug in the kernel that prevents .NET to work with CET enabled. I believe the fix was released about a year ago.

@mangod9
Copy link
Member

mangod9 commented Dec 2, 2024

Can we possibly report a better error here? Not sure how the assert shows up on release builds?

@MichalPetryka
Copy link
Contributor

Can we possibly report a better error here? Not sure how the assert shows up on release builds?

_ASSERTE_ALL_BUILDS(!AreShadowStacksEnabled() || UseSpecialUserModeApc());

It's a release assert.

@janvorli
Copy link
Member

janvorli commented Dec 2, 2024

Can we possibly report a better error here?

We can replace that assert by a check and failfast with a message that will make more sense.

@mangod9
Copy link
Member

mangod9 commented Dec 2, 2024

yeah a better error with some details on required windows versions would be good for better clarity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-VM-coreclr untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

6 participants