Open johnW-ret opened 2 days ago
Tagging subscribers to this area: @steveisok, @lambdageek See info in area-owners.md if you want to be subscribed.
Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.
In theory the interpreter should be able to handle tailcalls, but maybe we regressed? or there's some non-obvious interaction with AOT?
Description
Referencing F# code that utilizes tail calls in a C# WASM app does not perform TCO at runtime and a large enough stack will result in a
StackOverflowException
.Reproduction Steps
See johnW-ret/FsDataStackOverflowBug000 reproduction.
Expected behavior
(See repro) Weather.razor L31 should not throw a
StackOverflowException
Actual behavior
(See repro) Weather.razor L31 throws a
StackOverflowException
Regression?
Around 2024-10-03, the exceptions would not be throw on
Release
configuration but they would onDebug
. I am not sure if this was a regression at the time or not but it fixed my issue. Now it happens on all configurations.Known Workarounds
In theory, I could pass
--tailcalls-
tofsc
to avoid emitting thetail.
op, but the tail call is part of a library I am consuming and I do not want to setup a git submodule and rebuild the library.Configuration
Other information
No matter whether I pass
true
orfalse
forBlazorWebAssemblyJiterpreter
, the exception is still thrown.