Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT assert on arm64 when running DllImportGenerator tests: op2->TypeIs(TYP_LONG) #60624

Closed
AndyAyersMS opened this issue Oct 19, 2021 · 7 comments · Fixed by #62709
Closed

JIT assert on arm64 when running DllImportGenerator tests: op2->TypeIs(TYP_LONG) #60624

AndyAyersMS opened this issue Oct 19, 2021 · 7 comments · Fixed by #62709
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI disabled-test The test is disabled in source code against the issue
Milestone

Comments

@AndyAyersMS
Copy link
Member

https://dev.azure.com/dnceng/public/_build/results?buildId=1429275&view=ms.vss-test-web.build-test-results-tab

/root/helix/work/correlation/dotnet exec --runtimeconfig DllImportGenerator.Tests.runtimeconfig.json --depsfile DllImportGenerator.Tests.deps.json xunit.console.dll DllImportGenerator.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing 
popd
===========================================================================================================
/root/helix/work/workitem/e /root/helix/work/workitem/e
  Discovering: DllImportGenerator.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  DllImportGenerator.Tests (found 94 test cases)
  Starting:    DllImportGenerator.Tests (parallel test collections = on, max threads = 4)

Assert failure(PID 27 [0x0000001b], Thread: 40 [0x0028]): Assertion failed 'op2->TypeIs(TYP_LONG)' in 'Arrays:AndAllMembers(SharedTypes.BoolStruct[],int):bool' during 'Lowering nodeinfo' (IL size 180)

    File: /__w/2/s/src/coreclr/jit/gentree.cpp Line: 2449
    Image: /root/helix/work/correlation/dotnet

also seen in some PGO testing I did.

@dotnet-issue-labeler dotnet-issue-labeler bot added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI untriaged New issue has not been triaged by the area owner labels Oct 19, 2021
@ghost
Copy link

ghost commented Oct 19, 2021

Tagging subscribers to this area: @JulieLeeMSFT
See info in area-owners.md if you want to be subscribed.

Issue Details

https://dev.azure.com/dnceng/public/_build/results?buildId=1429275&view=ms.vss-test-web.build-test-results-tab

/root/helix/work/correlation/dotnet exec --runtimeconfig DllImportGenerator.Tests.runtimeconfig.json --depsfile DllImportGenerator.Tests.deps.json xunit.console.dll DllImportGenerator.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing 
popd
===========================================================================================================
/root/helix/work/workitem/e /root/helix/work/workitem/e
  Discovering: DllImportGenerator.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  DllImportGenerator.Tests (found 94 test cases)
  Starting:    DllImportGenerator.Tests (parallel test collections = on, max threads = 4)

Assert failure(PID 27 [0x0000001b], Thread: 40 [0x0028]): Assertion failed 'op2->TypeIs(TYP_LONG)' in 'Arrays:AndAllMembers(SharedTypes.BoolStruct[],int):bool' during 'Lowering nodeinfo' (IL size 180)

    File: /__w/2/s/src/coreclr/jit/gentree.cpp Line: 2449
    Image: /root/helix/work/correlation/dotnet

also seen in some PGO testing I did.

Author: AndyAyersMS
Assignees: -
Labels:

area-CodeGen-coreclr, untriaged

Milestone: -

@SingleAccretion
Copy link
Contributor

SingleAccretion commented Oct 19, 2021

Possibly easier reproduction:

@@ -4626,6 +4626,12 @@ void Lowering::ContainCheckMul(GenTreeOp* node)
     assert(node->OperIs(GT_MUL, GT_MULHI));
 #endif

+    if (node->OperIs(GT_MUL) && node->TypeIs(TYP_LONG))
+    {
+        assert(node->gtGetOp1()->TypeIs(TYP_LONG));
+        assert(node->gtGetOp2()->TypeIs(TYP_LONG));
+    }
+

Run SPMI on Windows x64 and see the following trees running around...

[000251] ---------U-- >>>          *  MUL       long
[000250] ------------              +--*  RSZ       int
[000020] ------------              |  +--*  LCL_VAR   int    V04 loc0         u:2 <l:$249, c:$248>
[000249] -c----------              |  \--*  CNS_INT   int    2
[000021] -------N----              \--*  CNS_INT   long   0x396B207F $48

Edit: or not, this appears to be a different issue.

@AaronRobinsonMSFT
Copy link
Member

/cc @jkoritzinsky @elinor-fung

@elinor-fung elinor-fung changed the title Dll import tests failing with jit assert on arm64: op2->TypeIs(TYP_LONG) JIT assert on arm64 when running DllImportGenerator tests: op2->TypeIs(TYP_LONG) Oct 22, 2021
@agocke agocke added the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Oct 22, 2021
@JulieLeeMSFT JulieLeeMSFT removed the untriaged New issue has not been triaged by the area owner label Nov 3, 2021
@JulieLeeMSFT JulieLeeMSFT added this to the 7.0.0 milestone Nov 3, 2021
@jkoritzinsky jkoritzinsky added disabled-test The test is disabled in source code against the issue and removed blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' labels Nov 10, 2021
@am11
Copy link
Member

am11 commented Dec 7, 2021

This assertion failed the CoreCLR Pri0 Runtime Tests Run Composite OSX arm64 checked build: https://dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_apis/build/builds/1500310/logs/416:

  Building Targeting Pack
  external -> 
  Compiling framework using Crossgen2: "/Users/runner/work/1/s/dotnet.sh" "/Users/runner/work/1/s/artifacts/tests/coreclr/OSX.arm64.Checked/Tests/Core_Root/R2RTest/R2RTest.dll" compile-framework -cr "/Users/runner/work/1/s/artifacts/tests/coreclr/OSX.arm64.Checked/Tests/Core_Root" --output-directory "/Users/runner/work/1/s/artifacts/tests/coreclr/obj/OSX.arm64.Checked/crossgen.out" --release --nocleanup --target-arch arm64 -dop 4 -m "/Users/runner/work/1/s/artifacts/tests/coreclr/OSX.arm64.Checked/Tests/Core_Root/StandardOptimizationData.mibc" --composite --verify-type-and-field-layout --crossgen2-path "/Users/runner/work/1/s/artifacts/bin/coreclr/OSX.arm64.Checked/x64/crossgen2/crossgen2.dll"
  Using dotnet: /Users/runner/work/1/s/.dotnet/dotnet
  1 / 1 (0%, 0 failed): launching: /Users/runner/work/1/s/.dotnet/dotnet /Users/runner/work/1/s/artifacts/bin/coreclr/OSX.arm64.Checked/x64/crossgen2/crossgen2.dll @/Users/runner/work/1/s/artifacts/tests/coreclr/obj/OSX.arm64.Checked/crossgen.out/framework-r2r.dll.rsp
  1 / 1 (100%, 1 failed): failed in 149283 msecs, exit code 133, expected 0: dotnet /Users/runner/work/1/s/artifacts/bin/coreclr/OSX.arm64.Checked/x64/crossgen2/crossgen2.dll @/Users/runner/work/1/s/artifacts/tests/coreclr/obj/OSX.arm64.Checked/crossgen.out/framework-r2r.dll.rsp
    /Users/runner/work/1/s/src/coreclr/jit/gentree.cpp:2449
    Assertion failed 'op2->TypeIs(TYP_LONG)' in 'System.Collections.Generic.ArraySortHelper`1:InsertionSort(System.Span`1[Microsoft.Diagnostics.Tracing.CLRRuntimeActivityComputer+StartStopThreadEventData],System.Comparison`1[Microsoft.Diagnostics.Tracing.CLRRuntimeActivityComputer+StartStopThreadEventData])' during 'Lowering nodeinfo' (IL size 116)
/Users/runner/work/1/s/src/tests/build.proj(519,5): error MSB3073: The command ""/Users/runner/work/1/s/dotnet.sh" "/Users/runner/work/1/s/artifacts/tests/coreclr/OSX.arm64.Checked/Tests/Core_Root/R2RTest/R2RTest.dll" compile-framework -cr "/Users/runner/work/1/s/artifacts/tests/coreclr/OSX.arm64.Checked/Tests/Core_Root" --output-directory "/Users/runner/work/1/s/artifacts/tests/coreclr/obj/OSX.arm64.Checked/crossgen.out" --release --nocleanup --target-arch arm64 -dop 4 -m "/Users/runner/work/1/s/artifacts/tests/coreclr/OSX.arm64.Checked/Tests/Core_Root/StandardOptimizationData.mibc" --composite --verify-type-and-field-layout --crossgen2-path "/Users/runner/work/1/s/artifacts/bin/coreclr/OSX.arm64.Checked/x64/crossgen2/crossgen2.dll"" exited with code 1.

@trylek
Copy link
Member

trylek commented Dec 11, 2021

Latest repro in my targeted CG2 testing:

https://dev.azure.com/dnceng/public/_build/results?buildId=1507562&view=logs&j=9fb4e71d-6fdc-50b9-1fe9-e6062f97f43b&t=2f5ed8ec-63ba-5d64-811a-336c2a4b4d47

  Compiling framework using Crossgen2: "/Users/runner/work/1/s/dotnet.sh" "/Users/runner/work/1/s/artifacts/tests/coreclr/OSX.arm64.Checked/Tests/Core_Root/R2RTest/R2RTest.dll" compile-framework -cr "/Users/runner/work/1/s/artifacts/tests/coreclr/OSX.arm64.Checked/Tests/Core_Root" --output-directory "/Users/runner/work/1/s/artifacts/tests/coreclr/obj/OSX.arm64.Checked/crossgen.out" --release --nocleanup --target-arch arm64 -dop 4 -m "/Users/runner/work/1/s/artifacts/tests/coreclr/OSX.arm64.Checked/Tests/Core_Root/StandardOptimizationData.mibc" --composite --verify-type-and-field-layout --crossgen2-path "/Users/runner/work/1/s/artifacts/bin/coreclr/OSX.arm64.Checked/x64/crossgen2/crossgen2.dll"
  Using dotnet: /Users/runner/work/1/s/.dotnet/dotnet
  1 / 1 (0%, 0 failed): launching: /Users/runner/work/1/s/.dotnet/dotnet /Users/runner/work/1/s/artifacts/bin/coreclr/OSX.arm64.Checked/x64/crossgen2/crossgen2.dll @/Users/runner/work/1/s/artifacts/tests/coreclr/obj/OSX.arm64.Checked/crossgen.out/framework-r2r.dll.rsp
  1 / 1 (100%, 1 failed): failed in 114584 msecs, exit code 133, expected 0: dotnet /Users/runner/work/1/s/artifacts/bin/coreclr/OSX.arm64.Checked/x64/crossgen2/crossgen2.dll @/Users/runner/work/1/s/artifacts/tests/coreclr/obj/OSX.arm64.Checked/crossgen.out/framework-r2r.dll.rsp
    /Users/runner/work/1/s/src/coreclr/jit/gentree.cpp:2257
    Assertion failed 'op2->TypeIs(TYP_LONG)' in 'System.Collections.Generic.ArraySortHelper`1:InsertionSort(System.Span`1[Microsoft.Diagnostics.Tracing.CLRRuntimeActivityComputer+StartStopThreadEventData],System.Comparison`1[Microsoft.Diagnostics.Tracing.CLRRuntimeActivityComputer+StartStopThreadEventData])' during 'Lowering nodeinfo' (IL size 116)

@am11
Copy link
Member

am11 commented Dec 13, 2021

Looks like it is failing since this change 220b746#diff-fba867eda1c745875748370c59da2195c3823b85a17d199444068d93f91c749bR2473-R2476
@SingleAccretion, should we convert those asserts back to conditions? (seems harmless)

@SingleAccretion
Copy link
Contributor

As I note above, the assert means something is creating invalid IR, I think we should fix that place instead.

It seems we have a CG2 reproduction now, so let me take a closer look.

@SingleAccretion SingleAccretion self-assigned this Dec 13, 2021
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Dec 13, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Dec 13, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jan 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI disabled-test The test is disabled in source code against the issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants