Repository navigation
Closed
Labels
Milestone
Description
Description
Loading Res before Wrapper avoids the crash entirely, so the failure is load-order dependent. Reproduces on Linux x64 on .NET 9.0.0 through 10.0.9.
Real-world trigger: NUnit test discovery (RuntimeModule.GetDefinedTypes() loads types in TypeDef order), where merely renaming a test file changed the load order and crashed the test host.
Reproduction Steps
Single file in a standard C# project:
using System;
Console.Out.Write("Loading..."); Console.Out.Flush();
var t = Type.GetType("Wrapper", throwOnError: true)!;
Console.WriteLine(" OK: " + t.Name);
public interface IResource<TSelf> where TSelf : IResource<TSelf>;
public readonly struct Handle<TResource> where TResource : IResource<TResource>;
public readonly struct Res : IResource<Res> { readonly Handle<Res> _handle; }
public readonly struct Wrapper { readonly Res _res; }
Project file for posterity:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
Expected behavior
Run the program and see "OK: Wrapper" on console output.
Actual behavior
Segmentation fault
Regression?
Tried with .NET 9 and .NET 10; fails on both; haven't tried earlier SDK versions
Known Workarounds
No response
Configuration
dotnet --info
.NET SDK:
Version: 10.0.301
Commit: 96856fd726
Workload version: 10.0.300-manifests.b0c14421
MSBuild version: 18.6.4+96856fd72
Runtime Environment:
OS Name: ubuntu
OS Version: 25.10
OS Platform: Linux
RID: linux-x64
Base Path: /usr/lib/dotnet/sdk/10.0.301/
.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.
Host:
Version: 10.0.9
Architecture: x64
Commit: 901ca94124
.NET SDKs installed:
9.0.118 [/usr/lib/dotnet/sdk]
10.0.109 [/usr/lib/dotnet/sdk]
10.0.201 [/usr/lib/dotnet/sdk]
10.0.301 [/usr/lib/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 9.0.17 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.5 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.9 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 9.0.17 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.5 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.9 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
DOTNET_BUNDLE_EXTRACT_BASE_DIR [/home/ben/.cache/dotnet_bundle_extract]
global.json file:
Not found
Other information
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
dotnet-policy-service commentedon Jul 14, 2026
Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.
MichalStrehovsky commentedon Jul 14, 2026
Hits an assert while we do SysV ABI classification which explains why it's Unix-like only:
This is very likely a duplicate of #127696.
Fix Linux crash loading recursive Nullable static-abstract value types (
Fix Linux crash loading recursive Nullable static-abstract value types (
MichalStrehovsky commentedon Jul 27, 2026
This was fixed in #130088 and the regression test is inlined into src/tests/Loader/classloader/regressions/GitHub_127696/GitHub_127696.cs.