Skip to content

Assertion failed '!varTypeIsFloating(op2Type)' in 'ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.conversions.target003.target003.TargetIsPredefinedValueType:NullableDoubleTypeWithNumericConversionFromFloatInAssignment():bool' during 'Generate code' #74172

Closed

Description

@BruceForstall

win-arm64 libraries random JitStress

https://dev.azure.com/dnceng/public/_build/results?buildId=1950959&view=ms.vss-test-web.build-test-results-tab&runId=50206106&resultId=198149&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab

D:\h\w\B477094B\w\A98309A7\e>set COMPlus 
COMPlus_JitStress=9b
COMPlus_TieredCompilation=0

D:\h\w\B477094B\w\A98309A7\e>call RunTests.cmd --runtime-path D:\h\w\B477094B\p 
----- start Thu 08/18/2022  0:20:39.78 ===============  To repro directly: ===================================================== 
pushd D:\h\w\B477094B\w\A98309A7\e\
"D:\h\w\B477094B\p\dotnet.exe" exec --runtimeconfig System.Dynamic.Runtime.Tests.runtimeconfig.json --depsfile System.Dynamic.Runtime.Tests.deps.json xunit.console.dll System.Dynamic.Runtime.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing 
popd
===========================================================================================================

D:\h\w\B477094B\w\A98309A7\e>"D:\h\w\B477094B\p\dotnet.exe" exec --runtimeconfig System.Dynamic.Runtime.Tests.runtimeconfig.json --depsfile System.Dynamic.Runtime.Tests.deps.json xunit.console.dll System.Dynamic.Runtime.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing  
  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 11480 [0x00002cd8], Thread: 14496 [0x38a0]): 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: D:\a\_work\1\s\src\coreclr\jit\codegenarm64.cpp Line: 4461
    Image: D:\h\w\B477094B\p\dotnet.exe

@dotnet/jit-contrib

Activity

  1. added
    JitStressCLR JIT issues involving JIT internal stress modes
    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
    on Aug 18, 2022
  2. added this to the 7.0.0 milestone on Aug 18, 2022
  3. TIHan commented on Aug 26, 2022

    @TIHan
    Contributor

    The test that caused the assertion is this:

            private static bool NullableDoubleTypeWithNumericConversionFromFloatInAssignment()
            {
                int failcount = 0;
                float? origin = +0.0f;
                dynamic d = origin;
                double? result = d;
                if (result != origin)
                {
                    failcount++;
                    System.Console.WriteLine("Test failed at conversion result");
                }
    
                return failcount == 0;
            }

    On isolating the test, I can't reproduce the assert:
    image

    @dotnet/jit-contrib How would you all try to reproduce this issue considering this is a JITStress?

  4. SingleAccretion commented on Aug 27, 2022

    @SingleAccretion
    Contributor

    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 ?

  5. kunalspathak commented on Aug 27, 2022

    @kunalspathak
    Contributor

    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.

  6. BruceForstall commented on Aug 29, 2022

    @BruceForstall
    ContributorAuthor

    https://github.com/orgs/dotnet/teams/jit-contrib How would you all try to reproduce this issue considering this is a JITStress?

    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".

  7. TIHan commented on Aug 30, 2022

    @TIHan
    Contributor

    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.

  8. TIHan commented on Aug 30, 2022

    @TIHan
    Contributor

    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
  9. TIHan commented on Aug 31, 2022

    @TIHan
    Contributor

    Still investigating, but the assert may be the result of #71705 .

  10. TIHan commented on Aug 31, 2022

    @TIHan
    Contributor

    Tested #74853 locally and it appears to resolve the issue. We'll have to wait for CI and run a JITStress on it.

  11. ghost locked as resolved and limited conversation to collaborators on Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

JitStressCLR JIT issues involving JIT internal stress modesarch-arm64area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIos-windows

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions