Open
Description
I found this bug because I created a thread in wasmfs_before_preload()
, which has __attribute__((init_priority(100)))
.
When the thread runs, embind has not been fully initialized in main thread. So Module['__embind_initialize_bindings']
did not register the types for me, but set initializedJS
to true.
I did not use embind in thread created in wasmfs_before_preload
, but the worker is reused in another thread, and in that thread embind does not work, caused a crash in my app.
I hope we can have a way to ensure wasm_init_ctors
are completed, or embind inited, when spawnthread
get called.