Skip to content

[NativeAOT] Throw/catching exceptions in a loop leads to Stack overflow #118913

@jkotas

Description

@jkotas

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

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions