runtime: [wasm][aot] Uncaught errors in `System.Runtime.Tests`

Build, and log:

info: Discovering: System.Runtime.Tests.dll (method display = ClassAndMethod, method display options = None)
info: Discovered:  System.Runtime.Tests.dll (found 8909 of 9059 test cases)
info: Using random seed for test cases: 867690635
info: Using random seed for collections: 867690635
info: Starting:    System.Runtime.Tests.dll
fail: 143503392
fail: 143503392
fail: 143503392
fail: 143503392
info: WASM EXIT 1
info: Waiting to flush log messages with a timeout of 120 secs ..
fail: Application has finished with exit code TESTS_FAILED but 0 was expected
fail: [out of order message from the browser]: http://127.0.0.1:49190/test-main.js 342:0 Uncaught (in promise)
fail: [out of order message from the browser]: http://127.0.0.1:49190/dotnet.js 1882:6 Uncaught
XHarness exit code: 71 (GENERAL_FAILURE)

This is when building [wasm] Unwrap exception when calling entrypoint (#74235) on main. /cc @maraf @pavelsavara

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (18 by maintainers)

Commits related to this issue

Most upvoted comments

Looking at this one, https://github.com/dotnet/runtime/issues/74302#issuecomment-1247760180, I think mono_wasm_invoke_method_bound or maybe mono_runtime_invoke (on wasm?) needs a C++ catch clause. because our LLVM code assumes it can throw and unwind until we get back to the interpreter (to do_jit_call), but in this case we have JS->C->C# and there’s no C# code to get back to. it’s happening with call_entry_point but it could probalby happen with other JS export entrypoints.

Actually I wonder if we’re missing a do_jit_call (or really mono_llvm_cpp_catch_exception) for some opcode?

Another thought: do we load/register AOT images asynchronously? is it possible we executed main before all the AOT images were loaded? So the interp thought it was doing a normal call, but by the time the exception is thrown we registered AOT images and they throw a C++ exception?