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

VN based copy prop assertion when enabling debug #77380

Closed
a74nh opened this issue Oct 24, 2022 · 4 comments · Fixed by #77389
Closed

VN based copy prop assertion when enabling debug #77380

a74nh opened this issue Oct 24, 2022 · 4 comments · Fixed by #77389
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@a74nh
Copy link
Contributor

a74nh commented Oct 24, 2022

Description

Arm64 Linux (Not sure about other targets).

Enabling COMPlus_JitDump for System.SpanHelpers:IndexOfNullCharacter
I get the following error:

Assert failure(PID 653538 [0x0009f8e2], Thread: 653538 [0x9f8e2]): Assertion failed '(m_array <= ssaDef) && (ssaDef < &m_array[m_count])' in 'System.SpanHelpers:IndexOfNullCharacter(byref):int' during 'VN based copy prop' (IL size 569; hash 0x1a78949a; Tier1)

Reproduction Steps

Simplest way to reproduce:

export COMPlus_JitDump=*
corerun helloworld.dll

Expected behavior

No assert failures

Actual behavior

dump_vn.txt

Assert failure(PID 655393 [0x000a0021], Thread: 655393 [0xa0021]): Assertion failed '(m_array <= ssaDef) && (ssaDef < &m_array[m_count])' in 'System.SpanHelpers:IndexOfNullCharacter(byref):int' during 'VN based copy prop' (IL size 569; hash 0x1a78949a; Tier1)

    File: /home/alahay01/dotnet/runtime_ccmp/src/coreclr/jit/compiler.h Line: 378
    Image: /home/alahay01/dotnet/runtime_ccmp/artifacts/bin/coreclr/Linux.arm64.Checked/corerun

Regression?

Used to work for me.

Known Workarounds

diff --git a/src/coreclr/jit/copyprop.cpp b/src/coreclr/jit/copyprop.cpp
index d029c8f3dce..1b859036eea 100644
--- a/src/coreclr/jit/copyprop.cpp
+++ b/src/coreclr/jit/copyprop.cpp
@@ -79,9 +79,9 @@ void Compiler::optDumpCopyPropStack(LclNumToLiveDefsMap* curSsaName)
     {
         GenTreeLclVarCommon* lclDefNode = iter.GetValue()->Top().GetDefNode()->AsLclVarCommon();
         unsigned             defLclNum  = iter.Get();
-        unsigned             defSsaNum  = lvaGetDesc(defLclNum)->GetSsaNumForSsaDef(iter.GetValue()->Top().GetSsaDef());
+        // unsigned             defSsaNum  = lvaGetDesc(defLclNum)->GetSsaNumForSsaDef(iter.GetValue()->Top().GetSsaDef());

-        JITDUMP("[%06d]:V%02u/%u ", dspTreeID(lclDefNode), defLclNum, defSsaNum);
+        JITDUMP("[%06d]:V%02u/%u ", dspTreeID(lclDefNode), defLclNum, 0);
     }
     JITDUMP("}\n\n");
 }

Configuration

Linux Arm64 Ubuntu 18.04

e232f79 2022-10-24.. Jan Kotas Temporary instrumentation for #76280 (#77365)

Other information

No response

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

ghost commented Oct 24, 2022

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

Issue Details

Description

Arm64 Linux (Not sure about other targets).

Enabling COMPlus_JitDump for System.SpanHelpers:IndexOfNullCharacter
I get the following error:

Assert failure(PID 653538 [0x0009f8e2], Thread: 653538 [0x9f8e2]): Assertion failed '(m_array <= ssaDef) && (ssaDef < &m_array[m_count])' in 'System.SpanHelpers:IndexOfNullCharacter(byref):int' during 'VN based copy prop' (IL size 569; hash 0x1a78949a; Tier1)

Reproduction Steps

Simplest way to reproduce:

export COMPlus_JitDump=*
corerun helloworld.dll

Expected behavior

No assert failures

Actual behavior

dump_vn.txt

Assert failure(PID 655393 [0x000a0021], Thread: 655393 [0xa0021]): Assertion failed '(m_array <= ssaDef) && (ssaDef < &m_array[m_count])' in 'System.SpanHelpers:IndexOfNullCharacter(byref):int' during 'VN based copy prop' (IL size 569; hash 0x1a78949a; Tier1)

    File: /home/alahay01/dotnet/runtime_ccmp/src/coreclr/jit/compiler.h Line: 378
    Image: /home/alahay01/dotnet/runtime_ccmp/artifacts/bin/coreclr/Linux.arm64.Checked/corerun

Regression?

Used to work for me.

Known Workarounds

diff --git a/src/coreclr/jit/copyprop.cpp b/src/coreclr/jit/copyprop.cpp
index d029c8f3dce..1b859036eea 100644
--- a/src/coreclr/jit/copyprop.cpp
+++ b/src/coreclr/jit/copyprop.cpp
@@ -79,9 +79,9 @@ void Compiler::optDumpCopyPropStack(LclNumToLiveDefsMap* curSsaName)
     {
         GenTreeLclVarCommon* lclDefNode = iter.GetValue()->Top().GetDefNode()->AsLclVarCommon();
         unsigned             defLclNum  = iter.Get();
-        unsigned             defSsaNum  = lvaGetDesc(defLclNum)->GetSsaNumForSsaDef(iter.GetValue()->Top().GetSsaDef());
+        // unsigned             defSsaNum  = lvaGetDesc(defLclNum)->GetSsaNumForSsaDef(iter.GetValue()->Top().GetSsaDef());

-        JITDUMP("[%06d]:V%02u/%u ", dspTreeID(lclDefNode), defLclNum, defSsaNum);
+        JITDUMP("[%06d]:V%02u/%u ", dspTreeID(lclDefNode), defLclNum, 0);
     }
     JITDUMP("}\n\n");
 }

Configuration

Linux Arm64 Ubuntu 18.04

e232f79 2022-10-24.. Jan Kotas Temporary instrumentation for #76280 (#77365)

Other information

No response

Author: a74nh
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@EgorBo
Copy link
Member

EgorBo commented Oct 24, 2022

@SingleAccretion do you think it is the same issue as #77362 ?

@SingleAccretion SingleAccretion self-assigned this Oct 24, 2022
@SingleAccretion
Copy link
Contributor

No, that is a different issue. Fix incoming.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Oct 24, 2022
@JulieLeeMSFT JulieLeeMSFT removed the untriaged New issue has not been triaged by the area owner label Oct 24, 2022
@JulieLeeMSFT JulieLeeMSFT added this to the 8.0.0 milestone Oct 24, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Oct 24, 2022
@a74nh
Copy link
Contributor Author

a74nh commented Oct 25, 2022

Confirmed this works for me now. Thanks.

@ghost ghost locked as resolved and limited conversation to collaborators Nov 24, 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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants