Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-s EXPORT_NAME=... + pthreads breaks in Node.js #14140

Open
RReverser opened this issue May 10, 2021 · 0 comments
Open

-s EXPORT_NAME=... + pthreads breaks in Node.js #14140

RReverser opened this issue May 10, 2021 · 0 comments

Comments

@RReverser
Copy link
Collaborator

Passing any custom -s EXPORT_NAME=... in combination with -pthread fails to execute the resulting code in Node.js:

rreverser@rreverser:~/emscripten$ ./emcc -pthread temp.c -o temp.js -s PTHREAD_POOL_SIZE=1 

rreverser@rreverser:~/emscripten$ node --experimental-wasm-threads --experimental-wasm-bulk-memory temp.js
Before Thread
Printing GeeksQuiz from Thread 
After Thread
main thread called exit: keepRuntimeAlive=true (counter=0)
program exited (with status: 0), but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)

rreverser@rreverser:~/emscripten$ ./emcc -pthread temp.c -o temp.js -s PTHREAD_POOL_SIZE=1 -s EXPORT_NAME=Smth

rreverser@rreverser:~/emscripten$ node --experimental-wasm-threads --experimental-wasm-bulk-memory temp.js
worker.js onmessage() captured an uncaught exception: ReferenceError: __filename is not defined
pthread sent an error! undefined:undefined: __filename is not defined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant