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

Test failure: JIT\Regression\JitBlue\GitHub_21990\GitHub_21990\GitHub_21990.cmd #70263

Closed
BruceForstall opened this issue Jun 5, 2022 · 6 comments · Fixed by #70916
Closed
Assignees
Labels
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
Milestone

Comments

@BruceForstall
Copy link
Member

runtime-jit-experimental, jit_osr_stress_random

D:\h\w\A6B3094B\w\B97F09EC\e>type D:\h\w\A6B3094B\w\B97F09EC\u\SetStressModes_jitosr_stress_random.cmd 
set COMPlus_TieredCompilation=1
set COMPlus_TC_OnStackReplacement=1
set COMPlus_TC_QuickJitForLoops=1
set COMPlus_TC_OnStackReplacement_InitialCounter=1
set COMPlus_OSR_HitLimit=2
set COMPlus_JitRandomOnStackReplacement=15

D:\h\w\A6B3094B\w\B97F09EC\e>set PATH=D:\h\w\A6B3094B\p\dotnet-cli;C:\python3.9.1\Scripts\;C:\python3.9.1\;C:\python3.7.0\Scripts\;C:\python3.7.0\;D:\Windows\system32;D:\Windows;D:\Windows\System32\Wbem;D:\Windows\System32\WindowsPowerShell\v1.0\;D:\Windows\System32\OpenSSH\;D:\Users\runner\AppData\Local\Microsoft\WindowsApps 

D:\h\w\A6B3094B\w\B97F09EC\e>set DOTNET_ROOT=D:\h\w\A6B3094B\p\dotnet-cli 

D:\h\w\A6B3094B\w\B97F09EC\e>set DOTNET_CLI_TELEMETRY_OPTOUT=1 

D:\h\w\A6B3094B\w\B97F09EC\e>set DOTNET_CLI_HOME=D:\h\w\A6B3094B\w\B97F09EC\e\.dotnet 

D:\h\w\A6B3094B\w\B97F09EC\e>set NUGET_PACKAGES=D:\h\w\A6B3094B\w\B97F09EC\e\.nuget 

D:\h\w\A6B3094B\w\B97F09EC\e>dotnet D:\h\w\A6B3094B\p\xunit\xunit.console.dll JIT\Regression\JIT.Regression.XUnitWrapper.dll -parallel collections -nocolor -noshadow -xml testResults.xml -trait TestGroup=JIT.Regression.JitBlue 
Microsoft.DotNet.XUnitConsoleRunner v2.5.0 (64-bit .NET 7.0.0-preview.3.22175.4)
  Discovering: JIT.Regression.XUnitWrapper (method display = ClassAndMethod, method display options = None)
  Discovered:  JIT.Regression.XUnitWrapper (found 227 of 1601 test cases)
  Starting:    JIT.Regression.XUnitWrapper (parallel test collections = on, max threads = 8)
    JIT\Regression\JitBlue\GitHub_21990\GitHub_21990\GitHub_21990.cmd [FAIL]
      
      Return code:      1
      Raw output file:      D:\h\w\A6B3094B\w\B97F09EC\uploads\Reports\JIT.Regression\JitBlue\GitHub_21990\GitHub_21990\GitHub_21990.output.txt
      Raw output:
      BEGIN EXECUTION
       "D:\h\w\A6B3094B\p\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false"  GitHub_21990.dll 
      Expected: 100
      Actual: -1073741819
      END EXECUTION - FAILED
      FAILED
      Test Harness Exitcode is : 1
      To run the test:
      > set CORE_ROOT=D:\h\w\A6B3094B\p
      > D:\h\w\A6B3094B\w\B97F09EC\e\JIT\Regression\JitBlue\GitHub_21990\GitHub_21990\GitHub_21990.cmd
      Expected: True
      Actual:   False
      Stack Trace:
           at JIT_Regression._JitBlue_GitHub_21990_GitHub_21990_GitHub_21990_._JitBlue_GitHub_21990_GitHub_21990_GitHub_21990_cmd()
      Output:
        
        Return code:      1
        Raw output file:      D:\h\w\A6B3094B\w\B97F09EC\uploads\Reports\JIT.Regression\JitBlue\GitHub_21990\GitHub_21990\GitHub_21990.output.txt
        Raw output:
        BEGIN EXECUTION
         "D:\h\w\A6B3094B\p\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false"  GitHub_21990.dll 
        Expected: 100
        Actual: -1073741819
        END EXECUTION - FAILED
        FAILED
        Test Harness Exitcode is : 1
        To run the test:
        > set CORE_ROOT=D:\h\w\A6B3094B\p
        > D:\h\w\A6B3094B\w\B97F09EC\e\JIT\Regression\JitBlue\GitHub_21990\GitHub_21990\GitHub_21990.cmd
  Finished:    JIT.Regression.XUnitWrapper
=== TEST EXECUTION SUMMARY ===
   JIT.Regression.XUnitWrapper  Total: 227, Errors: 0, Failed: 1, Skipped: 0, Time: 23.349s

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

@BruceForstall BruceForstall added 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 5, 2022
@ghost
Copy link

ghost commented Jun 5, 2022

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

Issue Details

runtime-jit-experimental, jit_osr_stress_random

D:\h\w\A6B3094B\w\B97F09EC\e>type D:\h\w\A6B3094B\w\B97F09EC\u\SetStressModes_jitosr_stress_random.cmd 
set COMPlus_TieredCompilation=1
set COMPlus_TC_OnStackReplacement=1
set COMPlus_TC_QuickJitForLoops=1
set COMPlus_TC_OnStackReplacement_InitialCounter=1
set COMPlus_OSR_HitLimit=2
set COMPlus_JitRandomOnStackReplacement=15

D:\h\w\A6B3094B\w\B97F09EC\e>set PATH=D:\h\w\A6B3094B\p\dotnet-cli;C:\python3.9.1\Scripts\;C:\python3.9.1\;C:\python3.7.0\Scripts\;C:\python3.7.0\;D:\Windows\system32;D:\Windows;D:\Windows\System32\Wbem;D:\Windows\System32\WindowsPowerShell\v1.0\;D:\Windows\System32\OpenSSH\;D:\Users\runner\AppData\Local\Microsoft\WindowsApps 

D:\h\w\A6B3094B\w\B97F09EC\e>set DOTNET_ROOT=D:\h\w\A6B3094B\p\dotnet-cli 

D:\h\w\A6B3094B\w\B97F09EC\e>set DOTNET_CLI_TELEMETRY_OPTOUT=1 

D:\h\w\A6B3094B\w\B97F09EC\e>set DOTNET_CLI_HOME=D:\h\w\A6B3094B\w\B97F09EC\e\.dotnet 

D:\h\w\A6B3094B\w\B97F09EC\e>set NUGET_PACKAGES=D:\h\w\A6B3094B\w\B97F09EC\e\.nuget 

D:\h\w\A6B3094B\w\B97F09EC\e>dotnet D:\h\w\A6B3094B\p\xunit\xunit.console.dll JIT\Regression\JIT.Regression.XUnitWrapper.dll -parallel collections -nocolor -noshadow -xml testResults.xml -trait TestGroup=JIT.Regression.JitBlue 
Microsoft.DotNet.XUnitConsoleRunner v2.5.0 (64-bit .NET 7.0.0-preview.3.22175.4)
  Discovering: JIT.Regression.XUnitWrapper (method display = ClassAndMethod, method display options = None)
  Discovered:  JIT.Regression.XUnitWrapper (found 227 of 1601 test cases)
  Starting:    JIT.Regression.XUnitWrapper (parallel test collections = on, max threads = 8)
    JIT\Regression\JitBlue\GitHub_21990\GitHub_21990\GitHub_21990.cmd [FAIL]
      
      Return code:      1
      Raw output file:      D:\h\w\A6B3094B\w\B97F09EC\uploads\Reports\JIT.Regression\JitBlue\GitHub_21990\GitHub_21990\GitHub_21990.output.txt
      Raw output:
      BEGIN EXECUTION
       "D:\h\w\A6B3094B\p\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false"  GitHub_21990.dll 
      Expected: 100
      Actual: -1073741819
      END EXECUTION - FAILED
      FAILED
      Test Harness Exitcode is : 1
      To run the test:
      > set CORE_ROOT=D:\h\w\A6B3094B\p
      > D:\h\w\A6B3094B\w\B97F09EC\e\JIT\Regression\JitBlue\GitHub_21990\GitHub_21990\GitHub_21990.cmd
      Expected: True
      Actual:   False
      Stack Trace:
           at JIT_Regression._JitBlue_GitHub_21990_GitHub_21990_GitHub_21990_._JitBlue_GitHub_21990_GitHub_21990_GitHub_21990_cmd()
      Output:
        
        Return code:      1
        Raw output file:      D:\h\w\A6B3094B\w\B97F09EC\uploads\Reports\JIT.Regression\JitBlue\GitHub_21990\GitHub_21990\GitHub_21990.output.txt
        Raw output:
        BEGIN EXECUTION
         "D:\h\w\A6B3094B\p\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false"  GitHub_21990.dll 
        Expected: 100
        Actual: -1073741819
        END EXECUTION - FAILED
        FAILED
        Test Harness Exitcode is : 1
        To run the test:
        > set CORE_ROOT=D:\h\w\A6B3094B\p
        > D:\h\w\A6B3094B\w\B97F09EC\e\JIT\Regression\JitBlue\GitHub_21990\GitHub_21990\GitHub_21990.cmd
  Finished:    JIT.Regression.XUnitWrapper
=== TEST EXECUTION SUMMARY ===
   JIT.Regression.XUnitWrapper  Total: 227, Errors: 0, Failed: 1, Skipped: 0, Time: 23.349s

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

Author: BruceForstall
Assignees: AndyAyersMS
Labels:

JitStress, area-CodeGen-coreclr

Milestone: -

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jun 5, 2022
@AndyAyersMS
Copy link
Member

See #65903 (comment)

This test creates a huge OSR method funclet frame. Recall on Arm64 OSR funclets need to pad by the size of the Tier0 frame, to keep PSPSym offsets the same between funclet and OSR method. Here the Tier0 frame is huge, and so forces the OSR funclet to likewise have a huge frame, and so unfortunately it also then needs a stack probe.

I was hoping to fix this by moving the Arm64 PSPSym above the register saves area which would make the offset in the OSR method small. But this seems less feasible now.

Thinking about this again I wonder if the OSR method can just reuse the Tier0 PSPSym slot. It shouldn't be possible for the OSR method to need a PSPSym if the Tier0 method didn't have one (at least until we enable inlining of methods with EH). So that slot in the Tier0 frame is just sitting there unused, and the OSR method could co-opt it.

That would make the OSR method caller-SP relative PSPSym offset very low, and so the OSR funclets could stop this crazy padding.

@BruceForstall
Copy link
Member Author

and so unfortunately it also then needs a stack probe.

This is in addition to the normal funclet stack probe that already exists to support a large outgoing arg area?

@AndyAyersMS
Copy link
Member

and so unfortunately it also then needs a stack probe.

This is in addition to the normal funclet stack probe that already exists to support a large outgoing arg area?

Not sure? I need to take a fresh look at this.

@JulieLeeMSFT JulieLeeMSFT removed the untriaged New issue has not been triaged by the area owner label Jun 8, 2022
@JulieLeeMSFT JulieLeeMSFT added this to the 7.0.0 milestone Jun 8, 2022
@AndyAyersMS
Copy link
Member

Current OSR funclet prolog is

;; Test_GitHub_21990:TestGenericContext(int):int

IN0045: 00010C                    mov     x9, #0x9ce0
IN0046: 000110                    sub     sp, sp, x9
IN0047: 000114                    stp     fp, lr, [sp]
IN0048: 000118                    stp     x19, x20, [sp,#32]
IN0049: 00011C                    mov     x2, #0x9ce0
IN004a: 000120                    add     x3, fp, x2
IN004b: 000124                    str     x3, [sp,#24]

Could be I'm abusing the frame style here. and while the OSR method can have a type 1 (or whatever style) as the "probing" happens in the Tier0 frame and it is inheriting the T0 SP, but the funclet needs to do its own probing to skip over the ginormous padding it needs to ensure the PSP sym is at the right caller-SP relative offset.

I think reusing T0 PSP slot in the OSR method is the right long-term solution, but it means that the OSR method, OSR funclet and Tier0 method have to agree on the size of the save area (since the PSP sym sits below this), which means that T0 needs to reserve a maximal save area, which means we need to have the OSR method share this save area like we do on x64.

Doing all that now seems perhaps complicated, so I'll look into doing probing first.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jun 17, 2022
@BruceForstall
Copy link
Member Author

OSR funclets are the only case where we might need probing of the initial SP adjustment, as you mentioned in a comment in genFuncletProlog:

        // With OSR we may see large values for fiSpDelta1
        // (we really need to probe the frame, sigh)

AndyAyersMS added a commit to AndyAyersMS/runtime that referenced this issue Jun 22, 2022
We currently need to pad OSR funclet frames with the full size of the
Tier0 frame, and this paddign sits above the register save area. For
large Tier0 frames we thus need to probe the stack in the OSR prolog
for type1 and type3 frames, before doing the initial SP adjustment and
save.

Longer term the plan is to revise arm64 OSR so we will not need to
do this padding; at that point we can remove this extra probing.

Fixes dotnet#70263.
AndyAyersMS added a commit that referenced this issue Jun 23, 2022
We currently need to pad OSR funclet frames with the full size of the
Tier0 frame, and this paddign sits above the register save area. For
large Tier0 frames we thus need to probe the stack in the OSR prolog
for type 1, 3, and 5 frames, before doing the initial SP adjustment and
save.

Longer term the plan is to revise arm64 OSR so we will not need to
do this padding; at that point we can remove this extra probing.

Fixes #70263.
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jun 23, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jul 23, 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 JitStress CLR JIT issues involving JIT internal stress modes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants