Skip to content

JIT: Byref store after suspension-point removed in runtime async #116090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jakobbotsch opened this issue May 29, 2025 · 1 comment · May be fixed by #116136
Open

JIT: Byref store after suspension-point removed in runtime async #116090

jakobbotsch opened this issue May 29, 2025 · 1 comment · May be fixed by #116136
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI runtime-async
Milestone

Comments

@jakobbotsch
Copy link
Member

// Generated by Fuzzlyn v3.2 on 2025-05-29 10:39:18
// Run on X64 Windows
// Seed: 2491652614975848521-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 151.4 KiB to 1.6 KiB in 00:00:53
// Release: Runs successfully
// Release with Runtime Async: Throws 'System.NullReferenceException'
using System;
using System.Numerics;
using System.Threading.Tasks;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;

public class Program
{
    public static IRuntime s_rt;
    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)
    {
        s_rt = rt;
        M0().GetAwaiter().GetResult();
    }

    public static async Task M0()
    {
        Vector256<int> var2 = default(Vector256<int>);
        for (ulong lvar0 = 2UL; lvar0 > 0UL; lvar0--)
        {
            await Task.Yield();
            Vector256<ulong>[] var1 = new Vector256<ulong>[]
            {
                Vector256.Create<ulong>(0)
            };
            s_rt.WriteLine("c_0", var2);
            s_rt.WriteLine("c_1", var1[0]);
            await Task.Yield();
            s_rt.WriteLine("c_2", lvar0);
        }
    }
}

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)
    {
    }
}
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label May 29, 2025
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label May 29, 2025
@jakobbotsch jakobbotsch added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners untriaged New issue has not been triaged by the area owner labels May 29, 2025
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI runtime-async
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants