Repository navigation
Closed
Labels
Priority:3Work that is nice to havearch-arm32area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone
Description
Description
The following program hits a JIT assert on arm32 when optimizing.
Reproduction Steps
// Generated by Fuzzlyn v1.5 on 2022-03-13 15:06:11
// Run on Arm Linux
// Seed: 6652345110448962334
// Reduced from 75.1 KiB to 3.2 KiB in 00:04:13
// Hits JIT assert in Release:
// Assertion failed '!foundMismatch' in 'Program:MainInner(IRuntime)' during 'LSRA allocate' (IL size 301; hash 0xade6b36b; FullOpts)
//
// File: /__w/1/s/src/coreclr/jit/lsra.cpp Line: 8123
//
public struct S0
{
public int F0;
public uint F4;
public byte F5;
public S0(byte f5): this()
{
}
}
public class C0
{
}
public class C1
{
public short F3;
public S0 F4;
public S0 F5;
}
public struct S1
{
public sbyte F0;
public C0 F1;
public C1 F2;
public C1 F3;
public ulong F4;
public int F5;
public uint F6;
public ulong F7;
public ulong F8;
public S1(sbyte f0, C0 f1, C1 f2, C1 f3, ulong f4, int f5, uint f6, ulong f7, ulong f8)
{
F0 = f0;
F1 = f1;
F2 = f2;
F3 = f3;
F4 = f4;
F5 = f5;
F6 = f6;
F7 = f7;
F8 = f8;
}
}
public struct S2
{
public S1 F2;
}
public struct S3
{
public long F0;
public uint F1;
}
public class Program
{
public static IRuntime s_rt;
public static C1 s_3;
public static S2 s_4;
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)
{
S2 vr6 = default(S2);
if (!!!(0 <= (uint)M1(ref s_3)))
{
try
{
s_rt.WriteLine("c_149", vr6.F2.F3.F4.F5);
}
finally
{
ref int vr7 = ref s_3.F4.F0;
for (int vr8 = 0; vr8 < -1; vr8++)
{
var vr9 = s_4.F2.F3.F3;
var vr10 = new byte[]{0};
var vr11 = new S3();
S0[] vr12 = M8(vr9, ref s_3.F5.F4, vr10, M11(vr11));
s_rt.WriteLine("c_462", vr12[0].F0);
s_rt.WriteLine("c_467", vr12[0].F5);
}
var vr13 = new S1(0, new C0(), new C1(), new C1(), 0, 0, 0, 0, 0);
var vr14 = new S1(0, new C0(), new C1(), new C1(), 0, 0, 0, 0, 0);
vr7 = vr7;
}
}
uint vr17 = s_3.F5.F4;
}
public static byte M1(ref C1 arg0)
{
for (int var0 = 0; var0 < 0; var0++)
{
}
uint var3 = arg0.F5.F4;
return 1;
}
public static ushort[][][] M11(S3 arg1)
{
return new ushort[][][]{new ushort[][]{new ushort[]{0}}};
}
public static S0[] M8(short arg0, ref uint arg2, byte[] arg3, ushort[][][] arg4)
{
return new S0[]{new S0(0)};
}
}
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)
{
}
}Expected behavior
No JIT assert hit.
Actual behavior
JIT assert is hit.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
category:correctness
theme:register-allocator
Metadata
Metadata
Assignees
Labels
Priority:3Work that is nice to havearch-arm32area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Activity
kunalspathak commentedon Apr 20, 2022
I am no longer able to repro this on latest main 544f720.
jakobbotsch commentedon May 2, 2022
New repro in https://dnceng.visualstudio.com/public/_build/results?buildId=1746386&view=ms.vss-build-web.run-extensions-tab
kunalspathak commentedon May 5, 2023
Don't see this reproing anymore in main. @jakobbotsch - if you see it happening, feel free to reopen with an updated example.
jakobbotsch commentedon May 22, 2023
Here's a new case:
jakobbotsch commentedon Aug 13, 2024
Doesn't repro with this example anymore. Will wait for a new one.