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

[wasm] Stack overflow in JIT/Directed/tailcall/tailcall/tailcall.sh on Linux #69517

Closed
Tracked by #69810
radical opened this issue May 18, 2022 · 8 comments · Fixed by #70050
Closed
Tracked by #69810

[wasm] Stack overflow in JIT/Directed/tailcall/tailcall/tailcall.sh on Linux #69517

radical opened this issue May 18, 2022 · 8 comments · Fixed by #70050
Assignees
Labels
arch-wasm WebAssembly architecture area-Codegen-meta-mono blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'
Milestone

Comments

@radical
Copy link
Member

radical commented May 18, 2022

Two tests failing with stack overflow on unrelated PR, build, and log:

  Starting:    JIT.Directed.XUnitWrapper (parallel test collections = on, max threads = 2)
    JIT/Directed/tailcall/tailcall/tailcall.sh [FAIL]
      
      Unhandled Exception:
      StackOverflowException
      [ERROR] FATAL UNHANDLED EXCEPTION: System.StackOverflowException: The requested operation caused a stack overflow.
         at Class1.Recurse4(Int32 depth, Object o1, Object o2)
         at Class1.Recurse3(Int32 depth)
         at Class1.Recurse2(Int32 depth, Object o1, Object o2)
         at Class1.Recurse1(Int32 depth)
         at Class1.Recurse4(Int32 depth, Object o1, Object o2)
         at Class1.Recurse3(Int32 depth)
         at Class1.Recurse2(Int32 depth, Object o1, Object o2)
...

And:

JIT/Directed/IL/Tailcall/ExplicitTailCallNoSO/ExplicitTailCallNoSO.sh [FAIL]
     
      Unhandled Exception:
      StackOverflowException
      [ERROR] FATAL UNHANDLED EXCEPTION: System.StackOverflowException: The requested operation caused a stack overflow.
         at ExplicitTailCallNoSO.CalculateSumWithTailCall(Int32 n, Int32 sum)
         at ExplicitTailCallNoSO.CalculateSumWithTailCall(Int32 n, Int32 sum)
         at ExplicitTailCallNoSO.CalculateSumWithTailCall(Int32 n, Int32 sum)
         at ExplicitTailCallNoSO.CalculateSumWithTailCall(Int32 n, Int32 sum)
         at ExplicitTailCallNoSO.CalculateSumWithTailCall(Int32 n, Int32 sum)
         at ExplicitTailCallNoSO.CalculateSumWithTailCall(Int32 n, Int32 sum)
         at ExplicitTailCallNoSO.CalculateSumWithTailCall(Int32 n, Int32 sum)
...

This was seen on other recent runs too.

@radical radical added the arch-wasm WebAssembly architecture label May 18, 2022
@ghost
Copy link

ghost commented May 18, 2022

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Two tests failing with stack overflow on unrelated PR, build, and log:

  Starting:    JIT.Directed.XUnitWrapper (parallel test collections = on, max threads = 2)
    JIT/Directed/tailcall/tailcall/tailcall.sh [FAIL]
      
      Unhandled Exception:
      StackOverflowException
      [ERROR] FATAL UNHANDLED EXCEPTION: System.StackOverflowException: The requested operation caused a stack overflow.
         at Class1.Recurse4(Int32 depth, Object o1, Object o2)
         at Class1.Recurse3(Int32 depth)
         at Class1.Recurse2(Int32 depth, Object o1, Object o2)
         at Class1.Recurse1(Int32 depth)
         at Class1.Recurse4(Int32 depth, Object o1, Object o2)
         at Class1.Recurse3(Int32 depth)
         at Class1.Recurse2(Int32 depth, Object o1, Object o2)
...

And:

JIT/Directed/IL/Tailcall/ExplicitTailCallNoSO/ExplicitTailCallNoSO.sh [FAIL]
     
      Unhandled Exception:
      StackOverflowException
      [ERROR] FATAL UNHANDLED EXCEPTION: System.StackOverflowException: The requested operation caused a stack overflow.
         at ExplicitTailCallNoSO.CalculateSumWithTailCall(Int32 n, Int32 sum)
         at ExplicitTailCallNoSO.CalculateSumWithTailCall(Int32 n, Int32 sum)
         at ExplicitTailCallNoSO.CalculateSumWithTailCall(Int32 n, Int32 sum)
         at ExplicitTailCallNoSO.CalculateSumWithTailCall(Int32 n, Int32 sum)
         at ExplicitTailCallNoSO.CalculateSumWithTailCall(Int32 n, Int32 sum)
         at ExplicitTailCallNoSO.CalculateSumWithTailCall(Int32 n, Int32 sum)
         at ExplicitTailCallNoSO.CalculateSumWithTailCall(Int32 n, Int32 sum)
...

This was seen on other recent runs too.

Author: radical
Assignees: -
Labels:

arch-wasm

Milestone: -

@ghost ghost added the untriaged New issue has not been triaged by the area owner label May 18, 2022
@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 May 18, 2022
@radical radical added area-Codegen-meta-mono blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' and removed area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI labels May 18, 2022
@lewing
Copy link
Member

lewing commented May 25, 2022

@radical please open an meta issue with stack overflow related wasm problems and disable tests that are failing due to it. There is discussion spread across multiple issues right now.

@lewing lewing removed the untriaged New issue has not been triaged by the area owner label May 25, 2022
@lewing lewing added this to the 7.0.0 milestone May 25, 2022
radical added a commit to radical/runtime that referenced this issue May 26, 2022
`JIT/Directed/tailcall/tailcall/tailcall.sh`
Issue: dotnet#69517
radical added a commit that referenced this issue May 27, 2022
* [wasm] Disable runtime test failing due to stack overflow

`JIT/Directed/tailcall/tailcall/tailcall.sh`
Issue: #69517

* Also disable JIT/Directed/IL/Tailcall/ExplicitTailCallNoSO/ExplicitTailCallNoSO.sh

* try to fix the exclusion

* Fix path for exclusion
radical added a commit to radical/runtime that referenced this issue May 27, 2022
* [wasm] Disable runtime test failing due to stack overflow

`JIT/Directed/tailcall/tailcall/tailcall.sh`
Issue: dotnet#69517

* Also disable JIT/Directed/IL/Tailcall/ExplicitTailCallNoSO/ExplicitTailCallNoSO.sh

* try to fix the exclusion

* Fix path for exclusion
@BrzVlad
Copy link
Member

BrzVlad commented May 28, 2022

These tailcall tests fail because we run with debugger enabled, which disables all optimizations, including tailcall optimization. This means that it is normal to fail with stack overflow exception.

Did we just recently start running these tests with debug enabled on wasm ?

@radical
Copy link
Member Author

radical commented May 31, 2022

Did we just recently start running these tests with debug enabled on wasm ?

What exactly would this mean? Building in debug config?

@BrzVlad
Copy link
Member

BrzVlad commented May 31, 2022

@radical No. It means somebody enables the debugger, by calling mono_wasm_debugger_init. Not sure who calls this. @thaystg Any input here ?

@radical
Copy link
Member Author

radical commented May 31, 2022

@radical
Copy link
Member Author

radical commented May 31, 2022

I'll check locally

radical added a commit to radical/runtime that referenced this issue May 31, 2022
Fixes dotnet#69517

- Recent [wasm-app-host commit](6b3ea40) changed `WasmApp.targets` so
  `WasmDebugLevel` would be set to enable debugging if
  `Configuration==Debug`.
    - this broke some runtime tests which depend on tail call
    optimizations, which get disabled when debugging is enabled in the
    runtime.

- And the wasm apps for the runtime tests are being built with no
  configuration set, which defaults to `Debug`. Instead, propogate the
  config for the build to the wasm proxy (`WasmTestRunner`) projects too.

Fixes dotnet#69517 .
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label May 31, 2022
@radical
Copy link
Member Author

radical commented May 31, 2022

Opened #70050 to fix this.

radical added a commit that referenced this issue Jun 1, 2022
…70050)

* [wasm] Fix runtime test failing due to the app running in debug mode

Fixes #69517

- Recent [wasm-app-host commit](6b3ea40) changed `WasmApp.targets` so
  `WasmDebugLevel` would be set to enable debugging if
  `Configuration==Debug`.
    - this broke some runtime tests which depend on tail call
    optimizations, which get disabled when debugging is enabled in the
    runtime.

- And the wasm apps for the runtime tests are being built with no
  configuration set, which defaults to `Debug`. Instead, propogate the
  config for the build to the wasm proxy (`WasmTestRunner`) projects too.

Fixes #69517 .

* Revert "[wasm] Disable runtime test failing due to stack overflow (#69863)"

This reverts commit 61441fa.
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jun 1, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jul 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Codegen-meta-mono blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants