Open jeromelaban opened 4 years ago
/cc @vargaz
I tried creating a testcase based on this code, but cannot reproduce it. Does it fail for something like:
var t = new Timer(_ => { Console.WriteLine ("HELLO!");
});
as well ?
With a more recent build of mono (91e026de9db) the failure is different, and the HELLO!
is not displayed:
tid:2 messages: In thread, In Run
dotnet.js:1 tid:2 before timer
dotnet.js:1 tid:2 after timer
Error
at 665835 (http://localhost:52823/dotnet.js:1:21051)
at _emscripten_asm_const_iii (http://localhost:52823/dotnet.js:1:21272)
at wasm_logger (<anonymous>:wasm-function[3267]:0x9fea5)
at eglib_log_adapter (<anonymous>:wasm-function[6340]:0x118982)
at monoeg_g_logstr (<anonymous>:wasm-function[4726]:0xcfe15)
at monoeg_g_logv_nofree (<anonymous>:wasm-function[2300]:0x646c3)
at monoeg_assertion_message (<anonymous>:wasm-function[464]:0xdf49)
at mono_assertion_message (<anonymous>:wasm-function[224]:0x5120)
at mono_assertion_message_disabled (<anonymous>:wasm-function[141]:0x31ce)
at set_context (<anonymous>:wasm-function[2200]:0x60d27)
dotnet.js:1 * Assertion at /mnt/jenkins/workspace/test-mono-mainline-wasm/label/ubuntu-1804-amd64/mono/mini/interp/interp.c:425, condition `<disabled>' not met
put_char @ dotnet.js:1
dotnet.js:1
put_char @ dotnet.js:1
dotnet.js:1 Pthread aborting at Error
at abort (http://localhost:52823/dotnet.js:1:17847)
at _abort (http://localhost:52823/dotnet.js:1:132948)
at wasm_logger (<anonymous>:wasm-function[3267]:0x9fec7)
at eglib_log_adapter (<anonymous>:wasm-function[6340]:0x118982)
at monoeg_g_logstr (<anonymous>:wasm-function[4726]:0xcfe15)
at monoeg_g_logv_nofree (<anonymous>:wasm-function[2300]:0x646c3)
at monoeg_assertion_message (<anonymous>:wasm-function[464]:0xdf49)
at mono_assertion_message (<anonymous>:wasm-function[224]:0x5120)
at mono_assertion_message_disabled (<anonymous>:wasm-function[141]:0x31ce)
at set_context (<anonymous>:wasm-function[2200]:0x60d27)
+1
Steps to Reproduce
Using
theads-release
, with 384db9e89053822a2d51cc19d7084ce75a636b37:Where this JS file is available:
Current Behavior
Most probably right before executing the timer's callback.
Expected Behavior
I'm not too sure of the expected behavior of this code. Using the timer is about getting back on the main Javascript thread (because Threading.Timer uses
setTimeout
), but it may not be the right way to do that.