Open jeromelaban opened 2 years ago
Tagging subscribers to this area: @dotnet/ncl See info in area-owners.md if you want to be subscribed.
Author: | jeromelaban |
---|---|
Assignees: | - |
Labels: | `area-System.Net.Http` |
Milestone: | - |
Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.
Author: | jeromelaban |
---|---|
Assignees: | - |
Labels: | `arch-wasm`, `area-System.Net.Http`, `untriaged` |
Milestone: | - |
@vargaz using profile filtering, I've narrowed the issue down to it being one of those AOTed:
System.Runtime.CompilerServices.*?AsyncTask.*
Still a large number of methods, but better than nothing.
Also, using net8, the error comes up as follow:
Uncaught (in promise) at System.Threading.Tasks.TaskCompletionSource`1[[System.Runtime.InteropServices.JavaScript.JSObject, System.Runtime.InteropServices.JavaScript, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].SetException(Exception exception)
at System.Runtime.InteropServices.JavaScript.JavaScriptExports.CompleteTask(JSMarshalerArgument* arguments_buffer)
Error: TaskT_TransitionToFinal_AlreadyCompleted
at marshal_exception_to_js (http://localhost:63077/package_b46cfbfd8bed26910f6c35b75520b2fe0b0313b2/dotnet.js:5:39184)
at invoke_method_and_handle_exception (http://localhost:63077/package_b46cfbfd8bed26910f6c35b75520b2fe0b0313b2/dotnet.js:5:76021)
at runtimeHelpers.javaScriptExports.complete_task (http://localhost:63077/package_b46cfbfd8bed26910f6c35b75520b2fe0b0313b2/dotnet.js:5:80449)
at http://localhost:63077/package_b46cfbfd8bed26910f6c35b75520b2fe0b0313b2/dotnet.js:5:48587
Would it be possible to create a testcase which uses the normal .net build ?
I'm not able to reproduce with a normal .NET build, there must be an option that's doing something differently.
The exception above being raise is hiding this exception:
RuntimeError: null function or function signature mismatch
at System_Net_Http_System_Runtime_CompilerServices_AsyncTaskMethodBuilder_Start_System_Net_Http_HttpContent__LoadIntoBufferAsyncCored__63_System_Net_Http_HttpContent__LoadIntoBufferAsyncCored__63_ (http://localhost:63077/package_afe58f4d046c9c3dd66af47785a06dd201d4a38c/dotnet.wasm:wasm-function[20015]:0x2a305a)
at corlib_aot_wrapper_gsharedvt_out_sig_void_this_bii (http://localhost:63077/package_afe58f4d046c9c3dd66af47785a06dd201d4a38c/dotnet.wasm:wasm-function[18891]:0x27100f)
at jit_call_cb (http://localhost:63077/package_afe58f4d046c9c3dd66af47785a06dd201d4a38c/dotnet.wasm:wasm-function[226]:0x2105d)
at mono_llvm_cpp_catch_exception (http://localhost:63077/package_afe58f4d046c9c3dd66af47785a06dd201d4a38c/dotnet.wasm:wasm-function[16267]:0x208847)
at do_jit_call (http://localhost:63077/package_afe58f4d046c9c3dd66af47785a06dd201d4a38c/dotnet.wasm:wasm-function[173]:0x1fc48)
at interp_exec_method (http://localhost:63077/package_afe58f4d046c9c3dd66af47785a06dd201d4a38c/dotnet.wasm:wasm-function[99]:0x10593)
at interp_entry (http://localhost:63077/package_afe58f4d046c9c3dd66af47785a06dd201d4a38c/dotnet.wasm:wasm-function[152]:0x1f049)
at interp_entry_instance_ret_2 (http://localhost:63077/package_afe58f4d046c9c3dd66af47785a06dd201d4a38c/dotnet.wasm:wasm-function[251]:0x21acd)
at System_Net_Http_aot_wrapper_gsharedvt_in_sig_obj_this_i8cl1d_Mono_dValueTuple_601_3cint_3e_ (http://localhost:63077/package_afe58f4d046c9c3dd66af47785a06dd201d4a38c/dotnet.wasm:wasm-function[20151]:0x2a954b)
at System_Net_Http_System_Net_Http_HttpClient___SendAsyncg__Core_83_0d_MoveNext (http://localhost:63077/package_afe58f4d046c9c3dd66af47785a06dd201d4a38c/dotnet.wasm:wasm-function[19773]:0x28947c)
Here's a repro with the vanilla .NET tooling. 77122-test-aot.zip
The issue only happens when HttpContent.LoadIntoBufferAsync
is not AOTed (because of https://github.com/mono/mono/issues/19824, which is now fixed)
cc @kotlarmilos
Description
When running the code below, the app crashes when built with an AOT profile. When running with the interpreter, or without a profile, the app runs properly.
Reproduction Steps
When running the following code using profiled AOT:
Profile: aot.zip Full repro: https://github.com/jeromelaban/Wasm.Samples/tree/master/AotIssueMismatch77122
Expected behavior
No crash, bytes are reported.
Actual behavior
Regression?
Yes, .NET 6 does not have this issue.
Known Workarounds
No response
Configuration
Tested on both: main: 9567f277c65 release/7.0: cd2d8379838
Other information
No response