wasmtime-dotnet
wasmtime-dotnet copied to clipboard
Trap Stackoverflow Test
My other PR (#151) was failing CI on MacOS only, I think this is due to a bug in wasmtime dotnet, although I'm not sure what and unfortunately I cannot debug it further since I don't own a Mac.
This PR includes the minimal set of changes to (hopefully) reproduce the problem.
Note that the nuint change is necessary to prevent an OverflowException (as mentioned in #150).
As expected this PR has failed CI. As mentioned above I can't debug it any further, I hope this helps someone with access to a Mac debug the issue.
I have been testing this, and found that Native.wasmtime_func_call crashes the test runner if the executed wasm overflows the stack. I have seen this happen on master, so this is a bug unrelated to this PR.
I've just put together a test of this in Rust which is fine when run on macos (using GH actions). So it seems to not be a bug in the underlying library.
I've been doing even more testing with GH actions.
As you can see from this execution log for this program works when you run it with:
dotnet run --project ConsoleApp/ConsoleApp/ConsoleApp.csproj
However, the same code copied into a test and run with:
dotnet test wasmtime-dotnet/tests/Wasmtime.Tests.csproj
Crashes!
I don't really have any ideas how to debug this further...
I'll dive into this soon and figure out why it's failing in the test host; perhaps it is installing a mach exception handler that is interfering with Wasmtime's.
I'll still be looking into this issue, but I'm not holding up the 1.0.0 release for it as I believe it's a test-host only problem.