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 'HBtab->ebdTryBeg->HasFlag(BBF_DONT_REMOVE)' during 'Remove empty try-catch-fault 2/3 #110958

Open
kunalspathak opened this issue Dec 26, 2024 · 2 comments
Labels
arch-x64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI os-windows untriaged New issue has not been triaged by the area owner

Comments

@kunalspathak
Copy link
Member

// Found by Antigen
// Reduced from 17.57 KB to 2.06 KB.


using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
using System.Runtime.Intrinsics.X86;
using System.Numerics;
public class TestClass
{
    long long_30 = 5;
    ulong ulong_36 = 0;
    SveMaskPattern SveMaskPattern_37 = SveMaskPattern.VectorCount1;
    private static List<string> toPrint = new List<string>();
    public void Method0()
    {
        unchecked
        {
            ulong ulong_77 = 2;
            SveMaskPattern SveMaskPattern_78 = SveMaskPattern_37;
            try
            {
                try
                {
                    ulong_36 -= ulong_77;
                }
                catch (System.FieldAccessException)
{}                catch (System.ExecutionEngineException)
                {
                }
            }
            catch (System.RankException)
            {
            }
            catch (System.MemberAccessException)
            {
                do
                {
                    try
                    {
                        switch ((15<<4)* long_30)
                        {
                            case -1:
                            {
                                break;
                            }
                            default:
                            {
                                break;
                            }
                        }
                    }
                    catch (System.InvalidProgramException)
                    {
                    }
                    catch (System.InvalidCastException)
                    {
                    }
                }
                while (15<4);
            }
            catch (System.AggregateException)
            {
            }
            finally
            {
            }
            return;
        }
    }
    public static void Main(string[] args)
    {
      Antigen();
    }
    public static int Antigen()
    {
        new TestClass().Method0();
        return string.Join(Environment.NewLine, toPrint).GetHashCode();
    }
}
/*
Environment:

set DOTNET_JitCFGUseDispatcher=1
set DOTNET_JitRandomEdgeCounts=1
set DOTNET_JitAlignLoops=0
set DOTNET_JitClassProfiling=0
set DOTNET_JitStressEvexEncoding=1
set DOTNET_TieredCompilation=0
set DOTNET_PreferredVectorBitWidth=512
set DOTNET_JitStress=2
set DOTNET_JitThrowOnAssertionFailure=1
set DOTNET_LegacyExceptionHandling=1

Debug: 467075166

Release: 0
JIT assert failed:
Assertion failed 'HBtab->ebdTryBeg->HasFlag(BBF_DONT_REMOVE)' in 'TestClass:Method0():this' during 'Remove empty try-catch-fault 2' (IL size 70; hash 0x46e9aa75; FullOpts)

    File: D:\a\_work\1\s\src\coreclr\jit\jiteh.cpp Line: 3236


*/

Might be related to #110954

@kunalspathak kunalspathak added arch-x64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI os-windows labels Dec 26, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Dec 26, 2024
Copy link
Contributor

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

@kunalspathak
Copy link
Member Author

// Found by Antigen
// Reduced from 24.81 KB to 3.62 KB.


using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
using System.Runtime.Intrinsics.X86;
using System.Numerics;
public class TestClass
{
    public struct S1
    {
        public struct S1_D1_F3
        {
            public Vector<short> v_short_3;
        }
        public int int_0;
    }
    public struct S2
    {
        public S1.S1_D1_F3 s1_s1_d1_f3_5;
    }
    static byte s_byte_7 = 2;
    static int s_int_12 = -2;
    static Vector128<float> s_v128_float_29 = Vector128.Create(1.0909091f, 0.031578947f, 5.2727275f, 0.025316456f);
    static Vector128<double> s_v128_double_30 = Vector128.Create(-2, 1.1111111111111112);
    static Vector512<uint> s_v512_uint_46 = Vector512.CreateScalar((uint)29);
    static Vector<double> s_v_double_60 = Vector<double>.Zero;
    static S1.S1_D1_F3 s_s1_s1_d1_f3_64 = new S1.S1_D1_F3();
    static S1 s_s1_65 = new S1();
    Vector128<int> v128_int_86 = Vector128.CreateScalar(5);
    Vector512<int> v512_int_106 = Vector512.Create(-2, 29, 29, -5, -1, 0, 1, 2, 1, -1, 0, -2, 29, -2, 5, -5);
    Vector512<uint> v512_uint_107 = Vector512.Create((uint)29, 0, 29, 5, 2, 29, 2, 2147483647, 29, 1, 2, 2147483647, 29, 2147483647, 2, 29);
    Vector<double> v_double_121 = Vector.Create(2147483647.1333334);
    S1 s1_126 = new S1();
    S2 s2_127 = new S2();
    private static List<string> toPrint = new List<string>();
    public S2 Method1(byte p_byte_128, short p_short_129, Vector512<int> p_v512_int_130, S1.S1_D1_F3 p_s1_s1_d1_f3_131, Vector128<int> p_v128_int_132, out Vector128<double> p_v128_double_133, S1 p_s1_134)
    {
        unchecked
        {
            p_v128_double_133 = Vector128.AsDouble(Vector128<float>.AllBitsSet - s_v128_float_29);
            try
            {
                if (Vector512.EqualsAll(s_v512_uint_46 += s_v512_uint_46 - v512_uint_107, s_v512_uint_46 - v512_uint_107))
                {
                    try
                    {
                        s2_127.s1_s1_d1_f3_5.v_short_3 += Vector.IsNaN(15*4* Vector<short>.AllBitsSet);
                    }
                    catch (System.TypeLoadException)
                    {
                    }
                    catch (System.NotSupportedException)
                    {
                    }
                    catch (System.CannotUnloadAppDomainException)
                    {
                        try
                        {
                            Vector.AsVectorByte(s_v_double_60 - (s_v_double_60 *= s_v_double_60)^ v_double_121 - s_v_double_60);
                        }
                        finally
                        {
                            s_int_12 %= 15|4;
                        }
                    }
                    catch (System.NullReferenceException)
                    {
                    }
                    finally
                    {
                    }
                }
                else
                {
                }
            }
            finally
            {
            }
            return s2_127;
        }
    }
    public void Method0()
    {
        unchecked
        {
            S2 s2_172 = new S2();
            s2_172 = Method1(s_byte_7 += (byte)(s_s1_65.int_0 %= 15|4), 15&4, v512_int_106 + v512_int_106, s_s1_s1_d1_f3_64, v128_int_86 = Vector128<int>.AllBitsSet* (15-4)- v128_int_86, out s_v128_double_30, s1_126);
            return;
        }
    }
    public static void Main(string[] args)
    {
      Antigen();
    }
    public static int Antigen()
    {
        new TestClass().Method0();
        return string.Join(Environment.NewLine, toPrint).GetHashCode();
    }
}
/*
Environment:

set DOTNET_JitDelegateProfiling=0
set DOTNET_JitELTHookEnabled=1
set DOTNET_TieredCompilation=0
set DOTNET_PreferredVectorBitWidth=512
set DOTNET_EnableLZCNT=1
set DOTNET_JitStressRegs=3
set DOTNET_TailcallStress=1
set DOTNET_JitThrowOnAssertionFailure=1
set DOTNET_LegacyExceptionHandling=1

Debug: -950813191

Release: 0
JIT assert failed:
Assertion failed 'HBtab->ebdTryBeg->HasFlag(BBF_DONT_REMOVE)' in 'TestClass:Method1(ubyte,short,System.Runtime.Intrinsics.Vector512`1[int],TestClass+S1+S1_D1_F3,System.Runtime.Intrinsics.Vector128`1[int],byref,TestClass+S1):TestClass+S2:this' during 'Remove empty try-catch-fault 3' (IL size 229; hash 0x6027a5ff; FullOpts)

    File: D:\a\_work\1\s\src\coreclr\jit\jiteh.cpp Line: 3236


*/

@kunalspathak kunalspathak changed the title Assertion failed 'HBtab->ebdTryBeg->HasFlag(BBF_DONT_REMOVE)' during 'Remove empty try-catch-fault 2 Assertion failed 'HBtab->ebdTryBeg->HasFlag(BBF_DONT_REMOVE)' during 'Remove empty try-catch-fault 2/3 Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-x64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI os-windows untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

1 participant