emscripten-core / emscripten-core/emscripten

table index out of bounds when create a thread from within dynamic library (the thread function is defined in dynamic library)

Open
#19,425 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

Please include the following in your bug report:

**Version of emscripten/emsdk:**
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.34 (57b21b8fdcbe3ebb523178b79465254668eab408)
clang version 17.0.0 (https://github.com/llvm/llvm-project a031f72187ce495b9faa4ccf99b1e901a3872f4b)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: D:\emsdk\upstream\bin

**Failing command line in full:**
worker.js onmessage() captured an uncaught exception: RuntimeError: table index is out of bounds

i'm trying to spawn a function defined in dynamical library.but I always get table index outof bounds, what are the alternatives? or is it simply impossible?

the defined function is not called by any other threads but this one, and the thread is immediately joined, the function is doing harmless things none other than calculations and printing stuff, there's no harmful api calls at all, this should be possible in the web sandbox since it can set the PC to the corresponding symbol start. but it seems the access is restricted.

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.