Skip to content

JIT: Assertion failed 'dsc->TypeGet() != TYP_BYREF' during 'Transform async' #115671

@jakobbotsch

Description

@jakobbotsch
// Generated by Fuzzlyn v3.1 on 2025-05-16 20:49:57
// Run on X64 Windows
// Seed: 7492449691343009375-async,runtimeasync,vectort,vector128,vector256,x86aes,x86avx,x86avx2,x86bmi1,x86bmi1x64,x86bmi2,x86bmi2x64,x86fma,x86lzcnt,x86lzcntx64,x86pclmulqdq,x86pclmulqdqv256,x86popcnt,x86popcntx64,x86sse,x86ssex64,x86sse2,x86sse2x64,x86sse3,x86sse41,x86sse41x64,x86sse42,x86sse42x64,x86ssse3,x86x86base
// Reduced from 29.4 KiB to 1.4 KiB in 00:01:06
// Hits JIT assert for Release with Runtime Async:
// Assertion failed 'dsc->TypeGet() != TYP_BYREF' in 'Program:M0()' during 'Transform async' (IL size 16; hash 0xaf50ff37; FullOpts)
//
//     File: C:\dev\dotnet\runtime2\src\coreclr\jit\async.cpp Line: 622
//
using System;
using System.Numerics;
using System.Threading.Tasks;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;

public struct S0
{
}

public class C0
{
}

public class Program
{
    public static int[] s_3;
    public static void Main()
    {
        CollectibleALC alc = new CollectibleALC();
        System.Reflection.Assembly asm = alc.LoadFromAssemblyPath(System.Reflection.Assembly.GetExecutingAssembly().Location);
        System.Reflection.MethodInfo mi = asm.GetType(typeof(Program).FullName).GetMethod(nameof(MainInner));
        System.Type runtimeTy = asm.GetType(typeof(Runtime).FullName);
        mi.Invoke(null, new object[] { System.Activator.CreateInstance(runtimeTy) });
    }

    public static void MainInner(IRuntime rt)
    {
        M0();
    }

    public static async Task M0()
    {
        s_3 = await M2();
    }

    public async static Task<int[]> M2()
    {
        M3();
        return new int[]
        {
            -2147483647
        };
    }

    public static void M3()
    {
    }
}

public interface IRuntime
{
    void WriteLine<T>(string site, T value);
}

public class Runtime : IRuntime
{
    public void WriteLine<T>(string site, T value) => System.Console.WriteLine(value);
}

public class CollectibleALC : System.Runtime.Loader.AssemblyLoadContext
{
    public CollectibleALC() : base(true)
    {
    }
}

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIruntime-async

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions