-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Description
The following program:
public static class Test
{
private static void Main()
{
for (int i = 0; i < 100; i++)
{
CreateCollectibleDerived();
Thread.Sleep(16);
}
}
static void CreateCollectibleDerived()
{
ulong collectibleIndex = 0;
var ab = AssemblyBuilder.DefineDynamicAssembly(
new AssemblyName($"CollectibleDerivedAssembly{collectibleIndex}"), AssemblyBuilderAccess.Run);
var mob = ab.DefineDynamicModule($"CollectibleDerivedModule{collectibleIndex}");
mob.DefineType($"CollectibleDerived{collectibleIndex}", TypeAttributes.Class | TypeAttributes.Public, typeof(Test));
}
}crashes with
Assert failure(PID 42156 [0x0000a4ac], Thread: 23756 [0x5ccc]): SanityCheck()
CORECLR! MethodTable::Validate + 0x4D (0x00007ffe`c04cf77d)
CORECLR! Object::ValidateInner + 0xA9 (0x00007ffe`c04dd8a9)
CORECLR! Object::Validate + 0x88 (0x00007ffe`c04dd7a8)
CORECLR! WKS::GCHeap::Promote + 0xFF (0x00007ffe`c0aadfff)
CORECLR! PromoteCarefully + 0x120 (0x00007ffe`c05537f0)
CORECLR! GcEnumObject + 0x92 (0x00007ffe`c06d73e2)
CORECLR! GcInfoDecoder::ReportRegisterToGC + 0x4F5 (0x00007ffe`c0a2b805)
CORECLR! GcInfoDecoder::ReportSlotToGC + 0xEE (0x00007ffe`c0a2b8fe)
CORECLR! GcInfoDecoder::EnumerateLiveSlots + 0xFD9 (0x00007ffe`c0a2a289)
CORECLR! EECodeManager::EnumGcRefs + 0x5C3 (0x00007ffe`c0390e93)
File: C:\prj\runtime-main\src\coreclr\vm\methodtable.cpp Line: 8691
Image: C:\prj\runtime-main\artifacts\bin\coreclr\windows.x64.Checked\corerun.exe
with
DOTNET_TieredCompilation=0
DOTNET_GCStress=0xC
on Checked runtime (win-x64).
Even on .NET 7.0 branch for me.