-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Description
Environment:
SDK-Version: 10.0.102
Microsoft.NETCore.App 10.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 10.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Visual Studio 2026, Jan 2026 Update, 18.2.1
x64 Build, Release only (doesn't happen in Debug builds)
Application is a c# windows desktop app, calling into c++/cli, calling into c++ native.
Symptoms:
• Exception: 0xC0000005: Access violation reading location 0x0C
• Location: clrjit.dll during JIT compilation
• Happens when managed C# calls C++/CLI code that returns structs with aggregate initialization
Context:
- This worked fine with net 4.8
- TieredCompilation settings didn't help
- Multiple aggregate returns in call chain compound the issue
TieredCompilation settings that i tried and that didn't help:
false
false
false
full
Reproduction Steps
It's a really big app (> projects, thousends of classes), i only have a pattern, not something that actually compiles.
// C++ Native
struct MyStruct { double a, b, c; };
MyStruct GetValue() {
return { 1.0, 2.0, 3.0 }; // ← Triggers JIT crash in .NET 10
}
// C++ Native
struct MyStruct { double a, b, c; };
MyStruct GetValue() {
return { 1.0, 2.0, 3.0 }; // ← Triggers JIT crash in .NET 10
}
Expected behavior
shouldn't crash in the jitter
Actual behavior
crashes in the jitter
Regression?
yes, this did work in .net framwork 4.8
Known Workarounds
removed the aggregate returns and replaced them with normal initialization of struct.
Configuration
- net core 1.0.0.2 (with windows desktop)
- windows 11 25H2, build 26200.7019
- x64
- all of my machines have this setup
Other information
No response