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-06-12 16:26:10
// Run on Arm Linux
// Seed: 4638851666693439758
// Reduced from 219.8 KiB to 1.7 KiB in 00:07:17
// Hits JIT assert in Release:
// Assertion failed 'inVarToRegMap[varIndex] == REG_STK' in 'Program:M41()' during 'LSRA allocate' (IL size 78; hash 0x996e4c42; FullOpts)
//
// File: /__w/1/s/src/coreclr/jit/lsra.cpp Line: 4040
//
public class Program
{
public static byte[, ] s_4;
public static ulong s_35;
public static int s_36;
public static int[, ] s_40;
public static int s_42;
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)
{
M41();
}
public static void M41()
{
for (int var0 = 0; var0 < 1; var0++)
{
return;
}
try
{
s_36 = s_36;
}
finally
{
ulong vr0 = default(ulong);
if (s_35 != vr0)
{
try
{
s_40 = s_40;
}
finally
{
for (int var6 = 0; var6 < 2; var6++)
{
}
}
}
s_4 = new byte[, ]{{0}};
s_42 = 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 assert hit.
Actual behavior
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.
kunalspathak commentedon Apr 24, 2022
This seems to still repro on Fuzzlyn - https://dev.azure.com/dnceng/public/_build/results?buildId=1735381&view=ms.vss-build-web.run-extensions-tab
jakobbotsch commentedon Jun 13, 2022
Edited the OP with a new example from yesterday's Fuzzlyn run.
kunalspathak commentedon May 5, 2023
Not able to repro this with main.
1 remaining item
jakobbotsch commentedon May 7, 2023
Here's a new one:
kunalspathak commentedon May 9, 2023
@jakobbotsch - can you confirm the repro steps? I would typically build a
Releasebinary from this code and useAltjitto repro it on windows machine.jakobbotsch commentedon May 9, 2023
That repros it for me using 32-bit arm32 altjit.
kunalspathak commentedon May 29, 2025
@jakobbotsch - do you still see this issue? I identified some of the problems a while back in arm LSRA resolution and sent out #109173 and #107493 and that should have fixed that.
JulieLeeMSFT commentedon Jul 7, 2025
@jakobbotsch, please close if this issue is fixed.