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

ASYNCIFY and INCOMING_MODULE_JS_API #21955

Open
MuTsunTsai opened this issue May 16, 2024 · 3 comments
Open

ASYNCIFY and INCOMING_MODULE_JS_API #21955

MuTsunTsai opened this issue May 16, 2024 · 3 comments

Comments

@MuTsunTsai
Copy link

I noticed that if I use ASYNCIFY and INCOMING_MODULE_JS_API together, then I must include noExitRuntime in the INCOMING_MODULE_JS_API list even if I don't actually provide it in the Module, otherwise Asyncify won't work. Apparently this has to do with this part of the code:

emscripten/src/library.js

Lines 3012 to 3019 in 9ac0425

$runtimeKeepaliveCounter: 0,
$keepRuntimeAlive__deps: ['$runtimeKeepaliveCounter'],
#if isSymbolNeeded('$noExitRuntime')
$keepRuntimeAlive: () => noExitRuntime || runtimeKeepaliveCounter > 0,
#else
$keepRuntimeAlive: () => runtimeKeepaliveCounter > 0,
#endif

Which implies that if noExitRuntime is not included in the list, keepRuntimeAlive() will always return false so Asyncify is impossible. But why would I add it to the list if I don't intend to provide it? This seems like a bug to me.

Version of emscripten/emsdk:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.59 (0e4c5994eb5b8defd38367a416d0703fd506ad81)
clang version 19.0.0git (https:/github.com/llvm/llvm-project df762a1643bb5b0b3c907611d118c82d4b68a39d)
Target: wasm32-unknown-emscripten
Thread model: posix
@sbc100
Copy link
Collaborator

sbc100 commented May 16, 2024

Thanks for the report and the detailed analysis. I think that is indeed a bug.

sbc100 added a commit to sbc100/emscripten that referenced this issue May 16, 2024
@sbc100 sbc100 closed this as completed in 4cf3682 May 17, 2024
@kripken
Copy link
Member

kripken commented May 17, 2024

Was this indeed fixed by #21958 ? I can't see the connection between that await fix and this issue which is related to noExitRuntime.

@sbc100 sbc100 reopened this May 17, 2024
@sbc100
Copy link
Collaborator

sbc100 commented May 17, 2024

sorry, no that was a mistake

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

3 participants