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

Assertion failed 'assertion->op2.u1.iconFlags != GTF_EMPTY' #70790

Closed
BruceForstall opened this issue Jun 15, 2022 · 5 comments · Fixed by #70852
Closed

Assertion failed 'assertion->op2.u1.iconFlags != GTF_EMPTY' #70790

BruceForstall opened this issue Jun 15, 2022 · 5 comments · Fixed by #70852
Assignees
Labels
arch-arm64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI JitStress CLR JIT issues involving JIT internal stress modes os-linux Linux OS (any supported distro)
Milestone

Comments

@BruceForstall
Copy link
Member

Failure in:

pipeline: runtime-coreclr libraries-jitstressregs
net7.0-Linux-Release-arm64-CoreCLR_checked-jitstressregs3
System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests

https://dev.azure.com/dnceng/public/_build/results?buildId=1825354&view=ms.vss-test-web.build-test-results-tab&runId=48379878&paneView=debug&resultId=192608

+ export COMPlus_TieredCompilation=0
+ export COMPlus_DbgEnableMiniDump=1
+ export COMPlus_DbgMiniDumpName=/home/helixbot/dotnetbuild/dumps/coredump.%d.dmp
+ export COMPlus_JitStressRegs=3
+ printenv
+ grep COMPlus
COMPlus_TieredCompilation=0
COMPlus_DbgMiniDumpName=/home/helixbot/dotnetbuild/dumps/coredump.%d.dmp
COMPlus_JitStressRegs=3
COMPlus_DbgEnableMiniDump=1
+ ./RunTests.sh --runtime-path /root/helix/work/correlation
----- start Wed Jun 15 04:35:42 UTC 2022 =============== To repro directly: =====================================================
pushd .
/root/helix/work/correlation/dotnet exec --runtimeconfig System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests.runtimeconfig.json --depsfile System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests.deps.json xunit.console.dll System.Text.Json.SourceGeneration.Roslyn3.11.Unit.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: System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests (found 24 test cases)
  Starting:    System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests (parallel test collections = on, max threads = 4)

Assert failure(PID 27 [0x0000001b], Thread: 41 [0x0029]): Assertion failed 'assertion->op2.u1.iconFlags != GTF_EMPTY' in 'Microsoft.CodeAnalysis.CSharp.Binder:BindNonGenericSimpleNamespaceOrTypeOrAliasSymbol(Microsoft.CodeAnalysis.CSharp.Syntax.IdentifierNameSyntax,Microsoft.CodeAnalysis.CSharp.BindingDiagnosticBag,Roslyn.Utilities.ConsList`1[[Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol, Microsoft.CodeAnalysis.CSharp, Version=3.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],bool,Microsoft.CodeAnalysis.CSharp.Symbols.NamespaceOrTypeSymbol):NamespaceOrTypeOrAliasSymbolWithAnnotations:this' during 'Assertion prop' (IL size 423; hash 0xca7cf7b9; FullOpts)

    File: /__w/1/s/src/coreclr/jit/assertionprop.cpp Line: 2035
    Image: /root/helix/work/correlation/dotnet

[createdump] Gathering state for process 27 dotnet
[createdump] Crashing thread 00000029 signal 00000006

@dotnet/jit-contrib

@BruceForstall BruceForstall added arch-arm64 os-linux Linux OS (any supported distro) JitStress CLR JIT issues involving JIT internal stress modes area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI labels Jun 15, 2022
@BruceForstall BruceForstall added this to the 7.0.0 milestone Jun 15, 2022
@ghost
Copy link

ghost commented Jun 15, 2022

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

Issue Details

Failure in:

pipeline: runtime-coreclr libraries-jitstressregs
net7.0-Linux-Release-arm64-CoreCLR_checked-jitstressregs3
System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests

https://dev.azure.com/dnceng/public/_build/results?buildId=1825354&view=ms.vss-test-web.build-test-results-tab&runId=48379878&paneView=debug&resultId=192608

+ export COMPlus_TieredCompilation=0
+ export COMPlus_DbgEnableMiniDump=1
+ export COMPlus_DbgMiniDumpName=/home/helixbot/dotnetbuild/dumps/coredump.%d.dmp
+ export COMPlus_JitStressRegs=3
+ printenv
+ grep COMPlus
COMPlus_TieredCompilation=0
COMPlus_DbgMiniDumpName=/home/helixbot/dotnetbuild/dumps/coredump.%d.dmp
COMPlus_JitStressRegs=3
COMPlus_DbgEnableMiniDump=1
+ ./RunTests.sh --runtime-path /root/helix/work/correlation
----- start Wed Jun 15 04:35:42 UTC 2022 =============== To repro directly: =====================================================
pushd .
/root/helix/work/correlation/dotnet exec --runtimeconfig System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests.runtimeconfig.json --depsfile System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests.deps.json xunit.console.dll System.Text.Json.SourceGeneration.Roslyn3.11.Unit.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: System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests (found 24 test cases)
  Starting:    System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests (parallel test collections = on, max threads = 4)

Assert failure(PID 27 [0x0000001b], Thread: 41 [0x0029]): Assertion failed 'assertion->op2.u1.iconFlags != GTF_EMPTY' in 'Microsoft.CodeAnalysis.CSharp.Binder:BindNonGenericSimpleNamespaceOrTypeOrAliasSymbol(Microsoft.CodeAnalysis.CSharp.Syntax.IdentifierNameSyntax,Microsoft.CodeAnalysis.CSharp.BindingDiagnosticBag,Roslyn.Utilities.ConsList`1[[Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol, Microsoft.CodeAnalysis.CSharp, Version=3.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]],bool,Microsoft.CodeAnalysis.CSharp.Symbols.NamespaceOrTypeSymbol):NamespaceOrTypeOrAliasSymbolWithAnnotations:this' during 'Assertion prop' (IL size 423; hash 0xca7cf7b9; FullOpts)

    File: /__w/1/s/src/coreclr/jit/assertionprop.cpp Line: 2035
    Image: /root/helix/work/correlation/dotnet

[createdump] Gathering state for process 27 dotnet
[createdump] Crashing thread 00000029 signal 00000006

@dotnet/jit-contrib

Author: BruceForstall
Assignees: -
Labels:

arch-arm64, os-linux, JitStress, area-CodeGen-coreclr

Milestone: 7.0.0

@jakobbotsch
Copy link
Member

Presumably from #70521, cc @SingleAccretion

@SingleAccretion
Copy link
Contributor

Indeed looks related; I am taking a look already.

@SingleAccretion SingleAccretion self-assigned this Jun 15, 2022
@SingleAccretion
Copy link
Contributor

SingleAccretion commented Jun 15, 2022

So, as suspected, the assert has been surfaced by #70521, however, the cause has been there for a long time.

In the dump (for the failure listed in the issue) we have the following tree (reconstructed manually):

EQ
  IND
    LCL_VAR ref
  COMMA
    ASG
      LCL_VAR V39
      COMMA
        ASG
          LCL_VAR V114
          CNS_INT 0x7F28B60008 $H // Neither this node nor $H are handles
        ADD                    $H // Notice this is wrong (doesn't include the offset)
          LCL_VAR V114         $H
          CNS_INT 0xD70
    LCL_VAR V39

As can be seen, CSE created a "base" VN with its "shared const" functionality, and that base VN was incorrectly assigned to the ADD node, here:

cseUse->gtVNPair = val->gtVNPair; // The 'cseUse' is equal to 'val'

val here was created earlier as val = m_pCompiler->gtNewIconNode(dsc->csdConstDefValue, cseLclVarTyp); and represents the "base" VN.

One thing that is not clear to me is how did the "base" VN turn out not to be a handle -- they're selected from values present in IR, it seems highly unlikely that user code could contain a non-handle value which was that close. Notably, CSE itself loses the "handle-ness" when it creates the "base" constant node, but here the source VN was not a handle.

Will continue the investigation tomorrow.

Edit: the "base" VN originated from a module ID (some VM pointer) that is not a handle.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jun 16, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jun 17, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jul 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI JitStress CLR JIT issues involving JIT internal stress modes os-linux Linux OS (any supported distro)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants