Skip to content
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

Assertion failed 'i < BitSetTraits::GetSize(env)' in during 'Redundant branch opts' #71599

Closed
jakobbotsch opened this issue Jul 3, 2022 · 1 comment · Fixed by #72440
Closed
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@jakobbotsch
Copy link
Member

// Generated by Fuzzlyn v1.5 on 2022-07-03 16:41:26
// Run on Arm64 MacOS
// Seed: 15254214336696406464
// Reduced from 47.2 KiB to 1.6 KiB in 00:00:23
// Hits JIT assert in Release:
// Assertion failed 'i < BitSetTraits::GetSize(env)' in 'Program:Main(Fuzzlyn.ExecutionServer.IRuntime)' during 'Redundant branch opts' (IL size 260; hash 0xade6b36b; FullOpts)
// 
//     File: /Users/runner/work/1/s/src/coreclr/jit/bitsetasshortlong.h Line: 261
// 
public class C0
{
    public ushort F0;
    public ulong F1;
}

public class C1
{
    public C0 F0;
    public C0 F3;
    public C0 F6;
}

public struct S0
{
    public bool F1;
    public ushort F3;
    public byte F6;
}

public struct S1
{
    public int F0;
}

public class Program
{
    public static IRuntime s_rt;
    public static C1[][] s_1;
    public static S0[] s_3;
    public static S1 s_7;
    public static void Main()
    {
        ushort[] vr2 = default(ushort[]);
        S0 vr3 = default(S0);
        bool vr4 = vr3.F1;
        byte vr5 = vr3.F6--;
        if (vr4)
        {
            try
            {
                s_rt.WriteLine(1);
            }
            finally
            {
                C1 vr6 = s_1[0][0];
                var vr7 = new long[]{1};
                var vr8 = vr6.F3;
                long[] vr10 = vr7;
                C0 vr11 = vr8;
                int vr13 = s_7.F0;
                s_rt.WriteLine(vr6.F0.F0);
                s_rt.WriteLine(vr6.F0.F1);
                s_rt.WriteLine(vr6.F6.F0);
            }

            if (!vr4)
            {
                s_1[0][0].F3.F0 = vr3.F3;
            }
        }

        for (int vr9 = 0; vr9 < 2; vr9++)
        {
            if (vr4)
            {
                s_3[0].F3 = vr2[0];
            }

            s_rt.WriteLine(vr9);
        }
    }
}

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

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

cc @EgorBo

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 3, 2022
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jul 3, 2022
@ghost
Copy link

ghost commented Jul 3, 2022

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

Issue Details
// Generated by Fuzzlyn v1.5 on 2022-07-03 16:41:26
// Run on Arm64 MacOS
// Seed: 15254214336696406464
// Reduced from 47.2 KiB to 1.6 KiB in 00:00:23
// Hits JIT assert in Release:
// Assertion failed 'i < BitSetTraits::GetSize(env)' in 'Program:Main(Fuzzlyn.ExecutionServer.IRuntime)' during 'Redundant branch opts' (IL size 260; hash 0xade6b36b; FullOpts)
// 
//     File: /Users/runner/work/1/s/src/coreclr/jit/bitsetasshortlong.h Line: 261
// 
public class C0
{
    public ushort F0;
    public ulong F1;
}

public class C1
{
    public C0 F0;
    public C0 F3;
    public C0 F6;
}

public struct S0
{
    public bool F1;
    public ushort F3;
    public byte F6;
}

public struct S1
{
    public int F0;
}

public class Program
{
    public static IRuntime s_rt;
    public static C1[][] s_1;
    public static S0[] s_3;
    public static S1 s_7;
    public static void Main()
    {
        ushort[] vr2 = default(ushort[]);
        S0 vr3 = default(S0);
        bool vr4 = vr3.F1;
        byte vr5 = vr3.F6--;
        if (vr4)
        {
            try
            {
                s_rt.WriteLine(1);
            }
            finally
            {
                C1 vr6 = s_1[0][0];
                var vr7 = new long[]{1};
                var vr8 = vr6.F3;
                long[] vr10 = vr7;
                C0 vr11 = vr8;
                int vr13 = s_7.F0;
                s_rt.WriteLine(vr6.F0.F0);
                s_rt.WriteLine(vr6.F0.F1);
                s_rt.WriteLine(vr6.F6.F0);
            }

            if (!vr4)
            {
                s_1[0][0].F3.F0 = vr3.F3;
            }
        }

        for (int vr9 = 0; vr9 < 2; vr9++)
        {
            if (vr4)
            {
                s_3[0].F3 = vr2[0];
            }

            s_rt.WriteLine(vr9);
        }
    }
}

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

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

cc @EgorBo

Author: jakobbotsch
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@EgorBo EgorBo self-assigned this Jul 3, 2022
@JulieLeeMSFT JulieLeeMSFT removed the untriaged New issue has not been triaged by the area owner label Jul 5, 2022
@JulieLeeMSFT JulieLeeMSFT added this to the 7.0.0 milestone Jul 5, 2022
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jul 19, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jul 19, 2022
Monniasza added a commit to Monniasza/Fuzzlyn that referenced this issue Aug 3, 2022
The bug: [Assertion failed 'i < BitSetTraits::GetSize(env)' in during 'Redundant branch opts'](dotnet/runtime#71599)
@ghost ghost locked as resolved and limited conversation to collaborators Aug 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants