-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Description
I'm attempting to run a basic FNA app with the interpreter mode of BlazorWebAssembly, and it almost works, except for one particular PInvoke call, which produces an error. When running in AOT mode, the program runs correctly.
Reproduction Steps
I have isolated the problematic PInvoke call and written a small sample project to demonstrate the bug. Clone the repo, run dotnet publish without any changes, then open the page on a local server to see the error appear. If you change the .csproj so that RunAOTCompilation is true, then running the page will print "Survived!" instead.
Expected behavior
In both Interp and AOT modes, the program should print "Survived!" with no errors.
Actual behavior
This error appears in the browser console:
console.trace() /__w/1/s/src/mono/mono/mini/aot-runtime-wasm.c:113 <disabled> dotnet.6.0.0-rc.2.21480.5.idrh62rvaw.js:1:17700
573339 http://127.0.0.1:8080/_framework/dotnet.6.0.0-rc.2.21480.5.idrh62rvaw.js:1
_emscripten_asm_const_int http://127.0.0.1:8080/_framework/dotnet.6.0.0-rc.2.21480.5.idrh62rvaw.js:1
<anonymous> http://127.0.0.1:8080/_framework/dotnet.wasm:1366317
<anonymous> http://127.0.0.1:8080/_framework/dotnet.wasm:1789101
<anonymous> http://127.0.0.1:8080/_framework/dotnet.wasm:860323
<anonymous> http://127.0.0.1:8080/_framework/dotnet.wasm:171148
<anonymous> http://127.0.0.1:8080/_framework/dotnet.wasm:20830
<anonymous> http://127.0.0.1:8080/_framework/dotnet.wasm:429713
<anonymous> http://127.0.0.1:8080/_framework/dotnet.wasm:1556460
<anonymous> http://127.0.0.1:8080/_framework/dotnet.wasm:1519821
<anonymous> http://127.0.0.1:8080/_framework/dotnet.wasm:739925
<anonymous> http://127.0.0.1:8080/_framework/dotnet.wasm:91490
<anonymous> http://127.0.0.1:8080/_framework/dotnet.wasm:1506065
_mono_wasm_invoke_method http://127.0.0.1:8080/_framework/dotnet.6.0.0-rc.2.21480.5.idrh62rvaw.js:1
_call_method_with_converted_args http://127.0.0.1:8080/_framework/dotnet.6.0.0-rc.2.21480.5.idrh62rvaw.js:1
call_method http://127.0.0.1:8080/_framework/dotnet.6.0.0-rc.2.21480.5.idrh62rvaw.js:1
bind_assembly_entry_point http://127.0.0.1:8080/_framework/dotnet.6.0.0-rc.2.21480.5.idrh62rvaw.js:1
call_assembly_entry_point http://127.0.0.1:8080/_framework/dotnet.6.0.0-rc.2.21480.5.idrh62rvaw.js:1
callEntryPoint http://127.0.0.1:8080/_framework/blazor.webassembly.js:1
Ct http://127.0.0.1:8080/_framework/blazor.webassembly.js:1
Regression?
Probably not, given that NativeFileReference is new to RC2.
Known Workarounds
None that I have found.
Configuration
.NET Version: .NET 6 rc2
OS: Windows 10 x64
Browsers: Chrome, Firefox
Other information
The file/line that the error points to is this: https://github.com/dotnet/runtime/blob/main/src/mono/mono/mini/aot-runtime-wasm.c#L113, which seems to imply this error is "CANNOT HANDLE INTERP ICALL SIG". (I don't know why this string isn't printed to the console, it would be helpful information.)