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

Runtime_76346 fails in jitstress on arm64 #76910

Closed
jakobbotsch opened this issue Oct 12, 2022 · 3 comments · Fixed by #76988
Closed

Runtime_76346 fails in jitstress on arm64 #76910

jakobbotsch opened this issue Oct 12, 2022 · 3 comments · Fixed by #76988
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI blocking-clean-ci-optional Blocking optional rolling runs JitStress CLR JIT issues involving JIT internal stress modes
Milestone

Comments

@jakobbotsch
Copy link
Member

jakobbotsch commented Oct 12, 2022

The test added for #76346 seems to fail under jitstress=2. Works fine without jitstress.

D:\h\w\AD9809AF\w\B39E099D\e>type D:\h\w\AD9809AF\w\B39E099D\u\SetStressModes_jitstress2.cmd 
set COMPlus_TieredCompilation=0
set COMPlus_JitStress=2

...

D:\h\w\AD9809AF\w\B39E099D\e>dotnet D:\h\w\AD9809AF\p\xunit\xunit.console.dll JIT\Regression\JIT.Regression.XUnitWrapper.dll -parallel collections -nocolor -noshadow -xml testResults.xml -trait TestGroup=JIT.Regression 
Microsoft.DotNet.XUnitConsoleRunner v2.5.0 (64-bit .NET 7.0.0-rc.1.22426.10)
  Discovering: JIT.Regression.XUnitWrapper (method display = ClassAndMethod, method display options = None)
  Discovered:  JIT.Regression.XUnitWrapper (found 685 of 1673 test cases)
  Starting:    JIT.Regression.XUnitWrapper (parallel test collections = on, max threads = 8)
    JIT\Regression\JitBlue\Runtime_76346\Runtime_76346\Runtime_76346.cmd [FAIL]
      
      Return code:      1
      Raw output file:      D:\h\w\AD9809AF\w\B39E099D\uploads\Reports\JIT.Regression\JitBlue\Runtime_76346\Runtime_76346\Runtime_76346.output.txt
      Raw output:
      BEGIN EXECUTION
       "D:\h\w\AD9809AF\p\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false"  Runtime_76346.dll 
      Running... 0
      In finally1
      try2... 0
      finally2... 0
      Expected: 100
      Actual: -2147483645
      END EXECUTION - FAILED
      FAILED
      Test Harness Exitcode is : 1
      To run the test:
      > set CORE_ROOT=D:\h\w\AD9809AF\p
      > D:\h\w\AD9809AF\w\B39E099D\e\JIT\Regression\JitBlue\Runtime_76346\Runtime_76346\Runtime_76346.cmd
      Expected: True
      Actual:   False
      Stack Trace:
           at JIT_Regression._JitBlue_Runtime_76346_Runtime_76346_Runtime_76346_._JitBlue_Runtime_76346_Runtime_76346_Runtime_76346_cmd()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
           at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)

Run: https://dev.azure.com/dnceng-public/public/_build/results?buildId=48223&view=ms.vss-test-web.build-test-results-tab&runId=976374&resultId=109511&paneView=dotnet-dnceng.dnceng-anon-build-release-tasks.helix-anon-test-information-tab

cc @BruceForstall

@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 12, 2022
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Oct 12, 2022
@ghost
Copy link

ghost commented Oct 12, 2022

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

Issue Details

The test added for #76346 seems to fail under jitstress. Works fine when not jitstress.

 Starting:    JIT.Regression.XUnitWrapper (parallel test collections = on, max threads = 8)
    JIT\Regression\JitBlue\Runtime_76346\Runtime_76346\Runtime_76346.cmd [FAIL]
      
      Return code:      1
      Raw output file:      D:\h\w\AD9809AF\w\B39E099D\uploads\Reports\JIT.Regression\JitBlue\Runtime_76346\Runtime_76346\Runtime_76346.output.txt
      Raw output:
      BEGIN EXECUTION
       "D:\h\w\AD9809AF\p\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false"  Runtime_76346.dll 
      Running... 0
      In finally1
      try2... 0
      finally2... 0
      Expected: 100
      Actual: -2147483645
      END EXECUTION - FAILED
      FAILED
      Test Harness Exitcode is : 1
      To run the test:
      > set CORE_ROOT=D:\h\w\AD9809AF\p
      > D:\h\w\AD9809AF\w\B39E099D\e\JIT\Regression\JitBlue\Runtime_76346\Runtime_76346\Runtime_76346.cmd
      Expected: True
      Actual:   False
      Stack Trace:
           at JIT_Regression._JitBlue_Runtime_76346_Runtime_76346_Runtime_76346_._JitBlue_Runtime_76346_Runtime_76346_Runtime_76346_cmd()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
           at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
      Output:
        
        Return code:      1
        Raw output file:      D:\h\w\AD9809AF\w\B39E099D\uploads\Reports\JIT.Regression\JitBlue\Runtime_76346\Runtime_76346\Runtime_76346.output.txt
        Raw output:
        BEGIN EXECUTION
         "D:\h\w\AD9809AF\p\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false"  Runtime_76346.dll 
        Running... 0
        In finally1
        try2... 0
        finally2... 0
        Expected: 100
        Actual: -2147483645
        END EXECUTION - FAILED
        FAILED
        Test Harness Exitcode is : 1
        To run the test:
        > set CORE_ROOT=D:\h\w\AD9809AF\p
        > D:\h\w\AD9809AF\w\B39E099D\e\JIT\Regression\JitBlue\Runtime_76346\Runtime_76346\Runtime_76346.cmd

Run: https://dev.azure.com/dnceng-public/public/_build/results?buildId=48223&view=ms.vss-test-web.build-test-results-tab&runId=976374&resultId=109511&paneView=dotnet-dnceng.dnceng-anon-build-release-tasks.helix-anon-test-information-tab

cc @BruceForstall

Author: jakobbotsch
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@jakobbotsch jakobbotsch added JitStress CLR JIT issues involving JIT internal stress modes blocking-clean-ci-optional Blocking optional rolling runs and removed untriaged New issue has not been triaged by the area owner labels Oct 12, 2022
@jakobbotsch jakobbotsch added this to the 8.0.0 milestone Oct 12, 2022
@BruceForstall BruceForstall self-assigned this Oct 12, 2022
@BruceForstall
Copy link
Member

BruceForstall commented Oct 12, 2022

Repros with just

set COMPlus_TieredCompilation=0
set COMPlus_JitStressModeNames=STRESS_EMITTER

@BruceForstall
Copy link
Member

This is a bug in the STRESS_EMITTER implementation of alignment instructions on arm64. In particular, if alignment is inserted after a BBJ_ALWAYS block, we insert breakpoint instead of NOP instructions. In this case, we have a BBJ_CALLFINALLY/BBJ_ALWAYS pair, and the code thinks the BBJ_ALWAYS is a "normal" branch, which it is not.

Additionally, the code adds alignment in the BBJ_CALLFINALLY/BBJ_ALWAYS block, which means the alignment gets included in the "cloned finally" region reported to the VM. This is probably undesirable.

BruceForstall added a commit to BruceForstall/runtime that referenced this issue Oct 13, 2022
The Runtime_76346 test exposed a case where, in the case of STRESS_EMITTER,
we were inserting breakpoint instructions instead of NOPs for loop alignment
when the alignment followed an unconditional branch. However, it wasn't
considering the case of a BBJ_CALLFINALLY/BBJ_ALWAYS pair immediately
followed by a loop head.

This pointed out that alignment instructions should never be inserted in that
BBJ_ALWAYS block, since that block shouldn't contain any code. Inserting the
alignment NOPs affected the reported range of the EH cloned finally region
in the FEATURE_EH_CALLFINALLY_THUNKS case.

In these special cases, we simply give up on trying to align the loop.

Fixes dotnet#76910
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Oct 13, 2022
BruceForstall added a commit that referenced this issue Oct 13, 2022
The Runtime_76346 test exposed a case where, in the case of STRESS_EMITTER,
we were inserting breakpoint instructions instead of NOPs for loop alignment
when the alignment followed an unconditional branch. However, it wasn't
considering the case of a BBJ_CALLFINALLY/BBJ_ALWAYS pair immediately
followed by a loop head.

This pointed out that alignment instructions should never be inserted in that
BBJ_ALWAYS block, since that block shouldn't contain any code. Inserting the
alignment NOPs affected the reported range of the EH cloned finally region
in the FEATURE_EH_CALLFINALLY_THUNKS case.

In these special cases, we simply give up on trying to align the loop.

No diffs.

Fixes #76910
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Oct 13, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Nov 13, 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 blocking-clean-ci-optional Blocking optional rolling runs JitStress CLR JIT issues involving JIT internal stress modes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants