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

Add pthread support for Emscripten build. #841

Closed
wants to merge 1 commit into from

Conversation

aleph1
Copy link

@aleph1 aleph1 commented Nov 22, 2024

When trying to load the built .js and .wasm files in current browsers (Chrome, Safari, Firefox), an error is triggered relating to pthreads. Adding the compiler and linker flags for Emscripten resolve the issue.

Chrome provides the most detailed error, and it is related to the TaskScheduler and pthread use:

test.js:546 Aborted(native code called abort())
test.js:564 Uncaught (in promise) RuntimeError: Aborted(native code called abort())
at abort (http://localhost:3000/js/test.js:564:11)
at __abort_js (http://localhost:3000/js/test.js:1060:7)
at test.wasm.abort (http://localhost:3000/js/test.wasm:wasm-function[1175]:0xdb538)
at test.wasm.std::__2::__throw_system_error(int, char const*) (http://localhost:3000/js/test.wasm:wasm-function[1180]:0xdb60f)
at test.wasm.std::__2::thread::thread<void (&)(enki::ThreadArgs const&), enki::ThreadArgs, void>(void (&)(enki::ThreadArgs const&), enki::ThreadArgs&&) (http://localhost:3000/js/test.wasm:wasm-function[885]:0xca7b9)
at test.wasm.enki::TaskScheduler::StartThreads() (http://localhost:3000/js/test.wasm:wasm-function[877]:0xc9c89)
at test.wasm.enki::TaskScheduler::Initialize(enki::TaskSchedulerConfig) (http://localhost:3000/js/test.wasm:wasm-function[967]:0xd0794)
at test.wasm.enkiInitTaskSchedulerWithConfig (http://localhost:3000/js/test.wasm:wasm-function[1044]:0xd3a59)
at test.wasm.TiltedStacks (http://localhost:3000/js/test.wasm:wasm-function[21]:0x3bcc)
at test.wasm.MultithreadingTest (http://localhost:3000/js/test.wasm:wasm-function[19]:0x2321)

@erincatto
Copy link
Owner

This is in #852

@erincatto erincatto closed this Dec 12, 2024
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

Successfully merging this pull request may close these issues.

2 participants