Repro
Publish with NativeAOT on Windows x64, current .NET 10 RC:
for (;;) try { GC.KeepAlive(new MyObject()); } catch { }
class MyObject
{
static MyObject()
{
throw new Exception();
}
}
Actual result
Stack overflow exception after a few seconds
Expected result
Runs indefinitely