emscripten-core / emscripten-core/emscripten

worker.js onmessage() captured an uncaught exception : runtimeError :invalid index into function table

Open
#15,833 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

i use the `emscripten_set_main_loop_arg` in pthread worker , and run the .wasm multiple times , there is an error :
`worker.js onmessage() captured an uncaught exception : runtimeError :invalid index into function table
RuntimeError: invalid index into function table at :wasm-function[200]:0x1adef8
at Object.invokeEntryPoint
at self.onmessage `

i say the same problem in https://github.com/emscripten-core/emscripten/issues/11715 , in the issue , he said ` I guess the solution is to change this code to actually stash the closure and keep it alive in a thread_local storage until emscripten_cancel_main_loop is called` , so how to keep it alive ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.