Description
I discovered a JIT CodeGen bug using automated differential fuzzing. The program produces different outputs (checksums) depending on whether Dynamic PGO and JitStressRegs are enabled.
Reproduction Steps
- Create a new .NET 8 console app:
dotnet new console -n ReproBug
- Important: Modify
ReproBug.csproj to allow unsafe blocks (required for the checksum function):
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
Expected behavior
set DOTNET_TieredCompilation=0
set DOTNET_TieredPGO=0
set COMPlus_JitStressRegs=0
dotnet run -c Release
The checksum should be 49B5F8F053C8A9CC regardless of PGO/Stress settings.
Actual behavior
set DOTNET_TieredCompilation=1
set DOTNET_TieredPGO=1
set COMPlus_JitStressRegs=2
set DOTNET_EnableAVX2=0
dotnet run -c Release
When Dynamic PGO is enabled alongside JitStressRegs=2 (and AVX2 disabled), the checksum changes to AB1CED180818F52B.
Regression?
Reproduces on: .NET 8.0 (Release Build)
Does NOT reproduce on: .NET 10.0 Preview (The behavior seems consistent on .NET 10, suggesting it might be fixed or behavior changed in main branch).
Known Workarounds
No response
Configuration
No response
Other information
The reproduction code includes:
A PGO warmup loop (40 iterations).
A ResetStatics method to ensure memory is clean between iterations.
Interfaces and Checksum logic required to run the generated code.
ReproTest.zip
Description
I discovered a JIT CodeGen bug using automated differential fuzzing. The program produces different outputs (checksums) depending on whether Dynamic PGO and
JitStressRegsare enabled.Reproduction Steps
dotnet new console -n ReproBugReproBug.csprojto allow unsafe blocks (required for the checksum function):Expected behavior
set DOTNET_TieredCompilation=0
set DOTNET_TieredPGO=0
set COMPlus_JitStressRegs=0
dotnet run -c Release
The checksum should be 49B5F8F053C8A9CC regardless of PGO/Stress settings.
Actual behavior
set DOTNET_TieredCompilation=1
set DOTNET_TieredPGO=1
set COMPlus_JitStressRegs=2
set DOTNET_EnableAVX2=0
dotnet run -c Release
When Dynamic PGO is enabled alongside JitStressRegs=2 (and AVX2 disabled), the checksum changes to AB1CED180818F52B.
Regression?
Reproduces on: .NET 8.0 (Release Build)
Does NOT reproduce on: .NET 10.0 Preview (The behavior seems consistent on .NET 10, suggesting it might be fixed or behavior changed in main branch).
Known Workarounds
No response
Configuration
No response
Other information
The reproduction code includes:
A PGO warmup loop (40 iterations).
A ResetStatics method to ensure memory is clean between iterations.
Interfaces and Checksum logic required to run the generated code.
ReproTest.zip