Skip to content

UnsafeAccessorType targeting non-existing type crashing on Linux #116676

Closed
@jkotas

Description

@jkotas

Repro:

dotnet run -c release on Linux:

using System.Runtime.CompilerServices;

for (int i = 0; ; i++)
{
    Console.WriteLine(i);
    Work(false);
}

[MethodImpl(MethodImplOptions.NoInlining)]
static void Work(bool f)
{
    if (f)
        DoesNotExist(null);
}

[UnsafeAccessor(UnsafeAccessorKind.Method)]
extern static void DoesNotExist([UnsafeAccessorType("DoesNotExist")] object a);

Actual result:

Crash with no error message after several thousands of iterations

Expected result:

Runs indefinitely

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions