You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Asyncify lists does not work correctly with dots #5271
Hmm, that could be a problem in wasm-ld where it demangles names into the names section, or it could be a problem in binaryen where it reads it. Can you look in the names section in the wasm binary (before binaryen runs) and see what appears there?
Looks correct, thanks... ok, I dug into this now since it's clear it's either an emscripten or a binaryen issue. Turns out it's on the emscripten side,
It looks like . is part of the escaping approach there, but the problem is that . is also a necessary character sometimes, with things like ... that appear in signatures.
cc @juj - what do you think the best solution is? One idea might be to not run unmangle_symbols_from_cmdline if the input arrives from a response file. Then at least response files would be a way to know exactly what you are getting. But maybe the escaping can be tweaked?
cc @juj - what do you think the best solution is? One idea might be to not run unmangle_symbols_from_cmdline if the input arrives from a response file. Then at least response files would be a way to know exactly what you are getting. But maybe the escaping can be tweaked?
Ouch, ellipsis never occurred to me, I thought I was taking three characters that were all never used in the LLVM name mangling.
Maybe it would be good idea not to unmangle if the input does come from a response file. That would lose the kind of "interchangeability", but given that the problem is a bit exotic shell expansion in the first place, maybe that would be ok.
Another way might be to look for another character than '.' to replace with a space, e.g. does - ever appear in a symbol name since it is an operator? Though that might become awkward, since it is a breaking change for existing users who might rely on that mangling. (maybe such users are very rare though)
Good point about interchangeability... yeah, special behavior for response files seems risky.
A breaking change might be an option. I hope it would affect few people while it unbreaks this.
Another option might be to special-case ..., that is to not unmangle a sequence of three dots. Or are there cases where three dots are needed in escaped form - I think no, since that would mean three spaces?
This still doesn't seem to be working (in Emscripten 4.0.16). I've specified assert_fail(char const*, ...) in my remove file, but it outputs this warning:
This still doesn't seem to be working (in Emscripten 4.0.16). I've specified assert_fail(char const*, ...) in my remove file, but it outputs this warning:
For some reason I thought I could only use wildcards at the beginning and end. Using one in the middle does work! But oddly asyncify-advise won't log anything (for other functions it logs [asyncify] vsnprintf is in the remove-list, ignore)
Maybe trying ASYNCIFY_IGNORE_INDIRECT and then ADDing back functions might be easier than working out which of the 315 "initial scan" functions I can remove. Thanks for the idea!
Activity
kripken commentedon Nov 17, 2022
Hmm, that could be a problem in wasm-ld where it demangles names into the names section, or it could be a problem in binaryen where it reads it. Can you look in the names section in the wasm binary (before binaryen runs) and see what appears there?
kripken commentedon Nov 17, 2022
(I mean, to look with a hex editor -
wasm-dismay be too late, if the bug is in binaryen parsing.)caiiiycuk commentedon Nov 17, 2022
I have this in wdosbox-x.wasm:
kripken commentedon Nov 17, 2022
Looks correct, thanks... ok, I dug into this now since it's clear it's either an emscripten or a binaryen issue. Turns out it's on the emscripten side,
emscripten-core/emscripten#13477
The function
unmangle_symbols_from_cmdlinereplaces.with spaces,https://github.com/emscripten-core/emscripten/blob/c215ec6ad3ded63c7e50cf818006ad1cac469b4a/emcc.py#L804-L806
It looks like
.is part of the escaping approach there, but the problem is that.is also a necessary character sometimes, with things like...that appear in signatures.cc @juj - what do you think the best solution is? One idea might be to not run
unmangle_symbols_from_cmdlineif the input arrives from a response file. Then at least response files would be a way to know exactly what you are getting. But maybe the escaping can be tweaked?juj commentedon Nov 22, 2022
Ouch, ellipsis never occurred to me, I thought I was taking three characters that were all never used in the LLVM name mangling.
Maybe it would be good idea not to unmangle if the input does come from a response file. That would lose the kind of "interchangeability", but given that the problem is a bit exotic shell expansion in the first place, maybe that would be ok.
Another way might be to look for another character than '.' to replace with a space, e.g. does
-ever appear in a symbol name since it is an operator? Though that might become awkward, since it is a breaking change for existing users who might rely on that mangling. (maybe such users are very rare though)kripken commentedon Nov 28, 2022
Good point about interchangeability... yeah, special behavior for response files seems risky.
A breaking change might be an option. I hope it would affect few people while it unbreaks this.
Another option might be to special-case
..., that is to not unmangle a sequence of three dots. Or are there cases where three dots are needed in escaped form - I think no, since that would mean three spaces?Fix WebAssembly#6047, WebAssembly#5271: Support one-line-one-function…
Fix WebAssembly#6047, WebAssembly#5271: Support one-line-one-function…
Support one-line-one-function file format for asyncify lists (WebAsse…
Support one-line-one-function file format for asyncify lists (WebAsse…
curiousdannii commentedon Nov 7, 2025
This still doesn't seem to be working (in Emscripten 4.0.16). I've specified
assert_fail(char const*, ...)in my remove file, but it outputs this warning:And the function isn't actually removed.
caiiiycuk commentedon Nov 7, 2025
I found that it's better to use wildcards like this:
This will match any variation of
assert_failcaiiiycuk commentedon Nov 7, 2025
Also, I use whitelists and wrote a small script to generate them from the error stack. The algorithm for generating the whitelist is:
P.S. You need pass -sASSERTIONS=1 while generating lists
curiousdannii commentedon Nov 7, 2025
For some reason I thought I could only use wildcards at the beginning and end. Using one in the middle does work! But oddly asyncify-advise won't log anything (for other functions it logs
[asyncify] vsnprintf is in the remove-list, ignore)Maybe trying ASYNCIFY_IGNORE_INDIRECT and then ADDing back functions might be easier than working out which of the 315 "initial scan" functions I can remove. Thanks for the idea!
caiiiycuk commentedon Nov 7, 2025
Yeah the support of wildcards is very limited