emscripten-core / emscripten-core/emscripten
Problem with EM_FUNC_SIG_PARAM_I64 when posting to main thread
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
Hello, I'm trying to use `emscripten_async_run_in_main_runtime_thread()` (as suggested in #8212). I'm getting the `"Invalid Emscripten pthread _do_call opcode!"` exception when trying to use it with an `int64_t` argument.
Sample code:
```cpp
void TrampolineMethod(int64_t arg) {}
// ...
emscripten_async_run_in_main_runtime_thread(
(EM_FUNC_SIG_RETURN_VALUE_V | EM_FUNC_SIG_WITH_N_PARAMETERS(1) |
EM_FUNC_SIG_SET_PARAM(0, EM_FUNC_SIG_PARAM_I64)),
&TrampolineMethod, static_cast(123));
```
DevTools show this exception:
```
Uncaught RuntimeError: abort(Assertion failed: 0 && "Invalid Emscripten pthread _do_call opcode!", at: /b/s/w/ir/k/install/emscripten/system/lib/pthread/library_pthread.c,347,_do_call) at Error
at jsStackTrace (chrome-extension://kkfjhpobikanfaakacenbjnmhebacpje/executable.js:2322:19)
at stackTrace (chrome-extension://kkfjhpobikanfaakacenbjnmhebacpje/executable.js:2339:16)
at abort (chrome-extension://kkfjhpobikanfaakacenbjnmhebacpje/executable.js:1683:44)
at ___assert_fail (chrome-extension://kkfjhpobikanfaakacenbjnmhebacpje/executable.js:2345:7)
at _do_call (chrome-extension://kkfjhpobikanfaakacenbjnmhebacpje/executable.wasm:wasm-function[6629]:0xe0f3d)
at emscripten_current_thread_process_queued_calls (chrome-extension://kkfjhpobikanfaakacenbjnmhebacpje/executable.wasm:wasm-function[6628]:0xe0670)
at emscripten_main_thread_process_queued_calls (chrome-extension://kkfjhpobikanfaakacenbjnmhebacpje/executable.wasm:wasm-function[6646]:0xe173e)
at chrome-extension://kkfjhpobikanfaakacenbjnmhebacpje/executable.js:1745:22
at Worker.worker.onmessage (chrome-extension://kkfjhpobikanfaakacenbjnmhebacpje/executable.js:2211:13)
at abort (chrome-extension://kkfjhpobikanfaakacenbjnmhebacpje/executable.js:1689:11)
at ___assert_fail (chrome-extension://kkfjhpobikanfaakacenbjnmhebacpje/executable.js:2345:7)
at _do_call (chrome-extension://kkfjhpobikanfaakacenbjnmhebacpje/executable.wasm:wasm-function[6629]:0xe0f3d)
at emscripten_current_thread_process_queued_calls (chrome-extension://kkfjhpobikanfaakacenbjnmhebacpje/executable.wasm:wasm-function[6628]:0xe0670)
at emscripten_main_thread_process_queued_calls (chrome-extension://kkfjhpobikanfaakacenbjnmhebacpje/executable.wasm:wasm-function[6646]:0xe173e)
at chrome-extension://kkfjhpobikanfaakacenbjnmhebacpje/executable.js:1745:22
at Worker.worker.onmessage (chrome-extension://kkfjhpobikanfaakacenbjnmhebacpje/executable.js:2211:13)
```
Browser version: Chrome 86.0.4240.193. Emsdk: 2.0.6.
Contributor guide
Assessment
This issue has not been assessed yet.