You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Assertion failed '!varTypeIsFloating(op2Type)' in 'ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.conversions.target003.target003.TargetIsPredefinedValueType:NullableDoubleTypeWithNumericConversionFromFloatInAssignment():bool' during 'Generate code' #74172
privatestaticboolNullableDoubleTypeWithNumericConversionFromFloatInAssignment(){intfailcount=0;float?origin=+0.0f;dynamicd=origin;double?result=d;if(result!=origin){failcount++;System.Console.WriteLine("Test failed at conversion result");}returnfailcount==0;}
On isolating the test, I can't reproduce the assert:
@dotnet/jit-contrib How would you all try to reproduce this issue considering this is a JITStress?
Does the self-contained reproduction have exactly the same name as the original one: ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.conversions.target003.target003.TargetIsPredefinedValueType:NullableDoubleTypeWithNumericConversionFromFloatInAssignment():bool ?
Also another thing to try out is marking NullableDoubleTypeWithNumericConversionFromFloatInAssignment as NoInlining? Probably easier thing would be to get JITDump of the failing method and attach windbg with COMPlus_JitBreak=NullableDoubleTypeWithNumericConversionFromFloatInAssignment to see what is going on.
While it can be useful to reproduce in isolation (so as to be easier to create a repro case), I would also try to debug in the original test. One thing to do is a superpmi collection running the original failing scenario, then replay just the assertion failure. It's probably easiest to do that if you replace the "dotnet.exe" invocation of xunit with "corerun.exe".
Thank you all for the suggestions. I am now able to reproduce the issue, but only if I run the System.Dynamic.Runtime.Tests.dll through the xunit console:
C:\Users\lolti\OneDrive\Desktop\runtime>R:\artifacts\tests\coreclr\windows.arm64.Checked\Tests\Core_Root\corerun.exe "R:\artifacts\bin\System.Dynamic.Runtime.Tests\Release\net7.0\xunit.console.dll""R:\artifacts\bin\System.Dynamic.Runtime.Tests\Release\net7.0\System.Dynamic.Runtime.Tests.dll"
Microsoft.DotNet.XUnitConsoleRunner v2.5.0 (64-bit .NET 8.0.0-dev)
Discovering: System.Dynamic.Runtime.Tests (method display = ClassAndMethod, method display options = None)
Discovered: System.Dynamic.Runtime.Tests (found 2901 test cases)
Starting: System.Dynamic.Runtime.Tests (parallel test collections = on, max threads = 8)
Assert failure(PID 9384 [0x000024a8], Thread: 10792 [0x2a28]): Assertion failed '!varTypeIsFloating(op2Type)' in 'ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.conversions.target003.target003.TargetIsPredefinedValueType:NullableDoubleTypeWithNumericConversionFromFloatInAssignment():bool' during 'Generate code' (IL size 182; hash 0x5fad480b; FullOpts)
File: C:\work\runtime\src\coreclr\jit\codegenarm64.cpp Line: 4461
Image: R:\artifacts\tests\coreclr\windows.arm64.Checked\Tests\Core_Root\corerun.exe
C:\Users\lolti\OneDrive\Desktop\runtime>R:\artifacts\tests\coreclr\windows.arm64.Checked\Tests\Core_Root\corerun.exe "R:\artifacts\bin\System.Dynamic.Runtime.Tests\Release\net7.0\xunit.console.dll""R:\artifacts\bin\System.Dynamic.Runtime.Tests\Release\net7.0\System.Dynamic.Runtime.Tests.dll"
Microsoft.DotNet.XUnitConsoleRunner v2.5.0 (64-bit .NET 8.0.0-dev)
Discovering: System.Dynamic.Runtime.Tests (method display = ClassAndMethod, method display options = None)
Discovered: System.Dynamic.Runtime.Tests (found 2901 test cases)
Starting: System.Dynamic.Runtime.Tests (parallel test collections = on, max threads = 8)
Assert failure(PID 7776 [0x00001e60], Thread: 5992 [0x1768]): Assertion failed '!varTypeIsFloating(op2Type)' in 'ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.conversions.target003.target003.TargetIsPredefinedValueType:NullableDoubleTypeWithNumericConversionFromFloatInAssignment():bool' during 'Generate code' (IL size 182; hash 0x5fad480b; FullOpts)
File: C:\work\runtime\src\coreclr\jit\codegenarm64.cpp Line: 4461
Image: R:\artifacts\tests\coreclr\windows.arm64.Checked\Tests\Core_Root\corerun.exe
I should be able to get a collection now and replay it. Though, I'm not sure how to "only" replay the assertion failure.
Ok, so it already creates a repro file for the failure. That's pretty great actually.
[16:58:16] Repro 1 .mc file(s) created for failures:
[16:58:16] c:\work\runtime\artifacts\spmi\repro.System.Dynamic.Runtime.Tests\repro-14356.mc
[16:58:16]
[16:58:16] To run a specific failure (replace JIT path and .mc filename as needed):
[16:58:16]
[16:58:16] c:\work\runtime\artifacts\tests\coreclr\windows.x64.Checked\Tests\Core_Root\superpmi.exe -target arm64 c:\work\runtime\artifacts\tests\coreclr\windows.x64.Checked\Tests\Core_Root\clrjit_universal_arm64_x64.dll c:\work\runtime\artifacts\spmi\repro.System.Dynamic.Runtime.Tests\xxxxx.mc
[16:58:16]
[16:58:16] Replay summary:
[16:58:16] Replay failures in 1 MCH files:
[16:58:16] c:\work\runtime\artifacts\spmi\mch\1b9551b8-21f4-4233-9c90-f3eabd6a322b.windows.arm64\System.Dynamic.Runtime.Tests.mch
Activity
TIHan commentedon Aug 26, 2022
The test that caused the assertion is this:
On isolating the test, I can't reproduce the assert:

@dotnet/jit-contrib How would you all try to reproduce this issue considering this is a JITStress?
SingleAccretion commentedon Aug 27, 2022
Does the self-contained reproduction have exactly the same name as the original one:
ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.conversions.target003.target003.TargetIsPredefinedValueType:NullableDoubleTypeWithNumericConversionFromFloatInAssignment():bool?kunalspathak commentedon Aug 27, 2022
Also another thing to try out is marking
NullableDoubleTypeWithNumericConversionFromFloatInAssignmentasNoInlining? Probably easier thing would be to getJITDumpof the failing method and attach windbg withCOMPlus_JitBreak=NullableDoubleTypeWithNumericConversionFromFloatInAssignmentto see what is going on.BruceForstall commentedon Aug 29, 2022
Hit again: https://dev.azure.com/dnceng/public/_build/results?buildId=1971993&view=ms.vss-test-web.build-test-results-tab&runId=50524504&resultId=100258&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab
BruceForstall commentedon Aug 29, 2022
While it can be useful to reproduce in isolation (so as to be easier to create a repro case), I would also try to debug in the original test. One thing to do is a superpmi collection running the original failing scenario, then replay just the assertion failure. It's probably easiest to do that if you replace the "dotnet.exe" invocation of xunit with "corerun.exe".
TIHan commentedon Aug 30, 2022
Thank you all for the suggestions. I am now able to reproduce the issue, but only if I run the
System.Dynamic.Runtime.Tests.dllthrough the xunit console:I should be able to get a collection now and replay it. Though, I'm not sure how to "only" replay the assertion failure.
TIHan commentedon Aug 30, 2022
Ok, so it already creates a repro file for the failure. That's pretty great actually.
TIHan commentedon Aug 31, 2022
Still investigating, but the assert may be the result of #71705 .
TIHan commentedon Aug 31, 2022
Tested #74853 locally and it appears to resolve the issue. We'll have to wait for CI and run a JITStress on it.