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

[jitosr_stress_random] Failures in System.Text related tests #83959

Closed
jakobbotsch opened this issue Mar 27, 2023 · 7 comments · Fixed by #84000
Closed

[jitosr_stress_random] Failures in System.Text related tests #83959

jakobbotsch opened this issue Mar 27, 2023 · 7 comments · Fixed by #84000
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI test-failure
Milestone

Comments

@jakobbotsch
Copy link
Member

There seem to be widespread failures in System.Text related tests in the jitosr_stress_random runs: https://dev.azure.com/dnceng-public/public/_build/results?buildId=217773&view=results

Example failure on windows-release-x64: https://helixre107v0xdcypoyl9e7f.blob.core.windows.net/dotnet-runtime-refs-heads-main-0dce5b8399ce429a95/System.Text.Encodings.Web.Tests/1/console.1cdfd228.log?helixlogtype=result

  Starting:    System.Text.Encodings.Web.Tests (parallel test collections = on, max threads = 4)
    System.Text.Encodings.Web.Tests.JavaScriptEncoderTests.JavaScriptEncode_Relaxed_StillEncodesForbiddenChars_Simple_Escaping [FAIL]
      Assert.Equal() Failure
                  ? (pos 2)
      Expected: \b
      Actual:   \by
                  ? (pos 2)
      Stack Trace:
        /_/src/libraries/System.Text.Encodings.Web/tests/JavaScriptEncoderTests.Relaxed.cs(75,0): at System.Text.Encodings.Web.Tests.JavaScriptEncoderTests.JavaScriptEncode_Relaxed_StillEncodesForbiddenChars_Simple(String input, String expected)
        /_/src/libraries/System.Text.Encodings.Web/tests/JavaScriptEncoderTests.Relaxed.cs(56,0): at System.Text.Encodings.Web.Tests.JavaScriptEncoderTests.JavaScriptEncode_Relaxed_StillEncodesForbiddenChars_Simple_Escaping()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(59,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)

cc @AndyAyersMS

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Mar 27, 2023
@ghost
Copy link

ghost commented Mar 27, 2023

Tagging subscribers to this area: @dotnet/area-system-text-encoding
See info in area-owners.md if you want to be subscribed.

Issue Details

There seem to be widespread failures in System.Text related tests in the jitosr_stress_random runs: https://dev.azure.com/dnceng-public/public/_build/results?buildId=217773&view=results

Example failure on windows-release-x64: https://helixre107v0xdcypoyl9e7f.blob.core.windows.net/dotnet-runtime-refs-heads-main-0dce5b8399ce429a95/System.Text.Encodings.Web.Tests/1/console.1cdfd228.log?helixlogtype=result

  Starting:    System.Text.Encodings.Web.Tests (parallel test collections = on, max threads = 4)
    System.Text.Encodings.Web.Tests.JavaScriptEncoderTests.JavaScriptEncode_Relaxed_StillEncodesForbiddenChars_Simple_Escaping [FAIL]
      Assert.Equal() Failure
                  ? (pos 2)
      Expected: \b
      Actual:   \by
                  ? (pos 2)
      Stack Trace:
        /_/src/libraries/System.Text.Encodings.Web/tests/JavaScriptEncoderTests.Relaxed.cs(75,0): at System.Text.Encodings.Web.Tests.JavaScriptEncoderTests.JavaScriptEncode_Relaxed_StillEncodesForbiddenChars_Simple(String input, String expected)
        /_/src/libraries/System.Text.Encodings.Web/tests/JavaScriptEncoderTests.Relaxed.cs(56,0): at System.Text.Encodings.Web.Tests.JavaScriptEncoderTests.JavaScriptEncode_Relaxed_StillEncodesForbiddenChars_Simple_Escaping()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(59,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)

cc @AndyAyersMS

Author: jakobbotsch
Assignees: -
Labels:

area-System.Text.Encoding, untriaged

Milestone: -

@eiriktsarpalis eiriktsarpalis added test-failure and removed untriaged New issue has not been triaged by the area owner labels Mar 27, 2023
@eiriktsarpalis eiriktsarpalis added this to the 8.0.0 milestone Mar 27, 2023
@AndyAyersMS
Copy link
Member

Probably from #83910

@AndyAyersMS AndyAyersMS self-assigned this Mar 27, 2023
@AndyAyersMS
Copy link
Member

Can repro; about 1100 OSR methods created.

Going to narrow this down by bisection via DOTNET_JitEnablePatchpointRange

@tarekgh tarekgh added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI and removed area-System.Text.Encoding labels Mar 27, 2023
@ghost
Copy link

ghost commented Mar 27, 2023

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

Issue Details

There seem to be widespread failures in System.Text related tests in the jitosr_stress_random runs: https://dev.azure.com/dnceng-public/public/_build/results?buildId=217773&view=results

Example failure on windows-release-x64: https://helixre107v0xdcypoyl9e7f.blob.core.windows.net/dotnet-runtime-refs-heads-main-0dce5b8399ce429a95/System.Text.Encodings.Web.Tests/1/console.1cdfd228.log?helixlogtype=result

  Starting:    System.Text.Encodings.Web.Tests (parallel test collections = on, max threads = 4)
    System.Text.Encodings.Web.Tests.JavaScriptEncoderTests.JavaScriptEncode_Relaxed_StillEncodesForbiddenChars_Simple_Escaping [FAIL]
      Assert.Equal() Failure
                  ? (pos 2)
      Expected: \b
      Actual:   \by
                  ? (pos 2)
      Stack Trace:
        /_/src/libraries/System.Text.Encodings.Web/tests/JavaScriptEncoderTests.Relaxed.cs(75,0): at System.Text.Encodings.Web.Tests.JavaScriptEncoderTests.JavaScriptEncode_Relaxed_StillEncodesForbiddenChars_Simple(String input, String expected)
        /_/src/libraries/System.Text.Encodings.Web/tests/JavaScriptEncoderTests.Relaxed.cs(56,0): at System.Text.Encodings.Web.Tests.JavaScriptEncoderTests.JavaScriptEncode_Relaxed_StillEncodesForbiddenChars_Simple_Escaping()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(59,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)

cc @AndyAyersMS

Author: jakobbotsch
Assignees: AndyAyersMS
Labels:

area-CodeGen-coreclr, test-failure

Milestone: 8.0.0

@AndyAyersMS
Copy link
Member

AndyAyersMS commented Mar 27, 2023

Isolated one method where OSR causes problems:

2658: JIT compiled System.Text.Encodings.Web.DefaultJavaScriptEncoder+EscaperImplementation:EncodeUtf16(System.Text.Rune,System.Span`1[ushort]):int:this [Tier1-OSR @0x19, IL size=59, code size=68, hash=0x2131b33c]

Codegen diff between main and main before #83910.

;; before
IN0008: 000025 movzx    rdx, byte  ptr [V03 rsp+90H]

;; after
IN0008: 000025 mov      edx, dword ptr [V03 rsp+90H]

@AndyAyersMS
Copy link
Member

Looks like small OSR locals that end up not getting allocated need to be normalize on load. We were getting this "for free" when we marked them as exposed.

@AndyAyersMS
Copy link
Member

Change is simple. Reviewing diffs (which are a bit more extensive than I would have expected) and seeing if I can come up with a good regression test.

AndyAyersMS added a commit to AndyAyersMS/runtime that referenced this issue Mar 27, 2023
When I changed the importation strategy for OSR in dotnet#83910 it
exposed a latent issue -- small OSR locals must normalized on load.

Fixes dotnet#83959.
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Mar 27, 2023
AndyAyersMS added a commit that referenced this issue Mar 28, 2023
When I changed the importation strategy for OSR in #83910 it
exposed a latent issue -- small OSR locals must normalized on load if
they were exposed at Tier0.

Fixes #83959.
Fixes #83960.
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Mar 28, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Apr 28, 2023
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 test-failure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants