-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Microsoft.Extensions.Logging.Tests fail on WASM with an assertion in mono_exception_new_by_name_domain #38337
Comments
…ft.Extensions.Logging Filed dotnet#38337 for the tests that cause a runtime assert. The rest are normal threading ignores.
I think this is due to Line 25 in 54d9241
The dynamic service provider engine is created by runtime/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceProvider.cs Lines 37 to 49 in 54d9241
It's possible that we can pass some options too the logger factory to create a different kind of service provider engine that might work on wasm. Not sure runtime/src/libraries/Microsoft.Extensions.Logging/src/LoggerFactory.cs Lines 94 to 101 in 54d9241
|
Longer stack trace: dbug: test[0] WASM-ERR: * Assertion at /Users/alklig/work/dotnet-runtime/hask-wasm/src/mono/mono/metadata/exception.c:109, condition `is_ok (error)' not met, function:mono_exception_new_by_name_domain, (null) assembly:System.Private.CoreLib.dll type:ArgumentException member:(null) dbug: test[0] WASM-ERR: dbug: test[0] ABORT: undefined dbug: test[0] Stacktrace: dbug: test[0] dbug: test[0] Error dbug: test[0] at Object.onAbort (runtime.js:160:13) dbug: test[0] at abort (dotnet.js:1643:22) dbug: test[0] at _abort (dotnet.js:6101:7) dbug: test[0] at wasm_logger (:wasm-function[8190]:0x207e5c) dbug: test[0] at eglib_log_adapter (:wasm-function[6345]:0x1adec1) dbug: test[0] at monoeg_g_logstr (:wasm-function[7267]:0x1d0ffe) dbug: test[0] at monoeg_g_logv_nofree (:wasm-function[7265]:0x1d0f25) dbug: test[0] at monoeg_assertion_message (:wasm-function[7269]:0x1d10b1) dbug: test[0] at mono_exception_new_by_name_domain (:wasm-function[2216]:0xb50b4) dbug: test[0] at mono_exception_new_by_name (:wasm-function[2226]:0xb5cb5) dbug: test[0] at mono_exception_new_by_name_msg (:wasm-function[2225]:0xb5a34) dbug: test[0] at mono_error_prepare_exception (:wasm-function[6278]:0x1aafed) dbug: test[0] at mono_error_convert_to_exception (:wasm-function[6285]:0x1ab5c7) dbug: test[0] at mono_error_convert_to_exception_handle (:wasm-function[2261]:0xb7789) dbug: test[0] at mono_error_set_pending_exception_slow (:wasm-function[2260]:0xb768c) dbug: test[0] at mono_error_set_pending_exception.6 (:wasm-function[3767]:0x1153a4) dbug: test[0] at mono_monitor_ensure_owned (:wasm-function[3777]:0x115d80) dbug: test[0] at mono_monitor_exit_internal (:wasm-function[3776]:0x115c6b) dbug: test[0] at mono_monitor_exit_icall (:wasm-function[3787]:0x116073) dbug: test[0] at mono_monitor_exit_icall_raw (:wasm-function[2959]:0xe45cf) dbug: test[0] at do_icall (:wasm-function[230]:0x1f496) dbug: test[0] at do_icall_wrapper (:wasm-function[190]:0x1d3f1) dbug: test[0] at interp_exec_method (:wasm-function[142]:0x75ef) dbug: test[0] at interp_run_finally (:wasm-function[151]:0x1b36c) dbug: test[0] at mono_handle_exception_internal (:wasm-function[615]:0x50b6c) dbug: test[0] at mono_handle_exception (:wasm-function[584]:0x4d20b) dbug: test[0] at interp_throw (:wasm-function[187]:0x1d25e) dbug: test[0] at interp_exec_method (:wasm-function[142]:0x7647) dbug: test[0] at interp_runtime_invoke (:wasm-function[140]:0x5876) dbug: test[0] at mono_jit_runtime_invoke (:wasm-function[909]:0x61f6c) dbug: test[0] at do_runtime_invoke (:wasm-function[4031]:0x128058) dbug: test[0] at mono_runtime_invoke_checked (:wasm-function[4029]:0x127f11) dbug: test[0] at mono_runtime_try_invoke_array (:wasm-function[4160]:0x130cfe) dbug: test[0] at mono_runtime_invoke_array_checked (:wasm-function[4163]:0x131452) dbug: test[0] at ves_icall_InternalInvoke (:wasm-function[2564]:0xca9c4) dbug: test[0] at ves_icall_InternalInvoke_raw (:wasm-function[2840]:0xde069) dbug: test[0] at do_icall (:wasm-function[230]:0x1f670) dbug: test[0] at do_icall_wrapper (:wasm-function[190]:0x1d3f1) dbug: test[0] at interp_exec_method (:wasm-function[142]:0x75ef) dbug: test[0] at interp_runtime_invoke (:wasm-function[140]:0x5876) dbug: test[0] at mono_jit_runtime_invoke (:wasm-function[909]:0x61f6c) dbug: test[0] at do_runtime_invoke (:wasm-function[4031]:0x128058) dbug: test[0] at mono_runtime_try_invoke (:wasm-function[4046]:0x128cf3) dbug: test[0] at mono_runtime_invoke (:wasm-function[4103]:0x12d0bd) dbug: test[0] at mono_wasm_invoke_method (:wasm-function[8186]:0x207c3e) dbug: test[0] at dotnet.js:1711:22 dbug: test[0] at ccall (dotnet.js:751:18) dbug: test[0] at dotnet.js:763:12 dbug: test[0] at Object.init (runtime.js:366:15) dbug: test[0] at runtime.js:245:9 dbug: test[0] at dotnet.js:7240:9 |
Some printf debugging shows that indeed we don't own the lockword on some monitor:
The initial part of the managed stack looks like this by the time we try to do the monitor exit:
|
Current theory is that we call |
Testcase:
This will print '2' under wasm, which means the finally clause is executed twice. |
It doesn't fail under the desktop interpreter, only on wasm. |
This happens because of differences in EH implementation on wasm. wasm hits this codepath:
So after this call in interp_runtime_invoke ():
This codepath is hit only on wasm:
That if block doesn't seem to do the right thing, which causes the different behavior with the testcase on wasm. |
The previous code would convert exceptions into errors which would be rethrown later, clearing the resume state. Hopefully fixes dotnet/runtime#38337.
The previous code would convert exceptions into errors which would be rethrown later, clearing the resume state. Hopefully fixes dotnet#38337.
…ft.Extensions.Logging (#38338) Filed dotnet/runtime#38337 for the tests that cause a runtime assert. The rest are normal threading ignores.
…0117) The previous code would convert exceptions into errors which would be rethrown later, clearing the resume state. Hopefully fixes dotnet/runtime#38337.
This will probably fail with a PNSE now. |
…ct instead, since the test still fails.
…tead, since the test still fails. (#39348)
Should be fixed. |
Some tests in Microsoft.Extensions.Logging.Tests fail with an assertion:
The problematic tests were disabled so to reproduce it you need to remove
runtime/src/libraries/Microsoft.Extensions.Logging/tests/Common/LoggerFactoryTest.cs
Line 202 in cd4c4c9
The text was updated successfully, but these errors were encountered: