-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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 impossible to use WHITELIST with multiple arg functions #9128
Comments
Does it work if you double- and single-quote them? We do this, not for
|
Seems no |
Thanks @caiiiycuk , yes, this looks like something I missed here. In fact we need fixes in two stages of parsing in order to handle it, I opened
With those two this should work properly, let me know if you test it. |
@kripken Still does not work. I am tested on emscripten/parse and binaryen/asyncify-names. The comma is handled properly, but looks like there is another problems with spaces after commas.
Original function name coded with spaces after comma \2c\20 where emscripten uses just \2c. |
The lists are comma separated, but the names can have internal commas since they are human-readable. This adds awareness of bracketing things, so void foo(int, double) is parsed as a single function name, properly. Helps emscripten-core/emscripten#9128
@caiiiycuk looks like an escaping issue, need extra quotes around the whole thing, the first command here fails while the second works: $ ./emcc -s ASYNCIFY=1 -s ASYNCIFY_WHITELIST=["DOS_ReadFile(unsigned short, unsigned char*, unsigned short*, bool)"] --profiling a.cpp
warning: Asyncify whitelist contained a non-existing function name: DOS_ReadFile(unsigned short,unsigned char*,unsigned short*,bool) ($DOS_ReadFile\28unsigned\20short\2cunsigned\20char*\2cunsigned\20short*\2cbool\29)
$ ./emcc -s ASYNCIFY=1 -s 'ASYNCIFY_WHITELIST=["DOS_ReadFile(unsigned short, unsigned char*, unsigned short*, bool)"]' --profiling a.cpp
$ It seems like the shell just removes the I'll add a clarification to the docs when I open the emscripten PR to add a test for this. |
#9132 now has extra warnings for escaping errors, and a test for that. |
Yes you right this was an shell escape error. Sorry again, but it didn't work when I pass file to whitelist.
error is:
|
Thanks @caiiiycuk , we didn't handle response files with newlines. Fix in that PR. |
I have similar issues with the D3 port (multiple args functions not working). Tried various extra quotes tricks, but no luck. in the --pass-arg=asyncify-whitelist@<...> of wasm-opt, I can see some weird string concatenation such as: I am using the 1.38.41-upstream, maybe some PR have not landed though. I'll wait a bit |
@gabrielcuvillier 1.38.41 should have all those fixes, so you may be seeing another bug. Can you provide your full emcc link command, and I'll try to reproduce? |
@kripken Yes. Reproducing the issue is very simple: in test.cpp (test.cpp.zip):
command: command (same as previous, without quotes): Either this is another bug, or something is not good on my system (?) |
The human-readable name is |
Great, that works! |
Huh... not so fast (still fails on windows): #9206 |
…-readable C++ names in -s lists, which is important for Asyncify (emscripten-core#9132) We have nice syntax for lists, -s LIST=[foo,bar] which works well in many cases. But sometimes the list contains items that contain ",", for example -s LIST=["foo(x, y)", "bar"]. To handle that properly, try to parse things that look like json using the json parser; if it fails go back to the old code. Together with WebAssembly/binaryen#2275 this fixes emscripten-core#9128 where the lists there actually do have ","s in them. Add testing for Asyncify lists with such names, and also added extra warnings for when escaping is confusing, and a test for that as well.
Related to #9094.
Hi, still can't use ASYNCIFY_WHITELIST because functions name from it is not mapped correctly to real function names from binary.
Testcase:
Next, build it with whitelist:
The problem is in
,
because it's treated as whitelist array delimiter not as function arguments delimiter. And escape didn't help:I tried also:
Results are same.
Actual function name in wasm binary:
I think
DOS_ReadFile\28unsigned\20short\2c\20unsigned\20char*\2c\20unsigned\20short*\2c\20bool\29
is exactDOS_ReadFile(unsigned short, unsigned char*, unsigned short*, bool)
if you decode it. Btw, passing \encoded names also not supported:Function name now is double escaped.
The text was updated successfully, but these errors were encountered: