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

WASM=0 + SINGLE_FILE=1 + O2 = corrupted argument #9430

Closed
Beuc opened this issue Sep 12, 2019 · 2 comments

Comments

@Beuc
Copy link
Contributor

commented Sep 12, 2019

Hi,

Following up on the weird zee.js issue that I've been tracking for the past few days:

repro.c:

#include <emscripten.h>

void repro2(const char*);

int main(void) {
  repro2("qsdfqsdf");
}

repro2.c:

#include <emscripten.h>
void repro2(const char* version) {
  EM_ASM_INT(console.log("repro2", $0, $1, $2, $3);, version, version[0], version[1], version[2]);
}
emcc -O2 -s WASM=0 -s SINGLE_FILE=1 -O3 -c -o repro.o repro.c
emcc -O2 -s WASM=0 -s SINGLE_FILE=1 -O3 -c -o repro2.o repro2.c
emcc -O2 -s WASM=0 -s SINGLE_FILE=1 repro.o repro2.o -o repro.js

nodejs (OK):

repro2 1024 113 115 100

Firefox, Chromium (KO):

repro2 1024 0 0 0

For some reason version now points to a "" string rather than "qsdfqsdf".
In zee.js, this causes a version check failure when comparing ZLIB_VERSION "1.2.5".

Note: same behavior with WASM_ASYNC_COMPILATION=0 .

Also, are you're interested in this kind of issue, or is WASM=0 is also deprecated or something? (I felt #9407 was closed a bit fast but maybe that's just me :))

@kripken

This comment has been minimized.

Copy link
Member

commented Sep 13, 2019

Hmm, this works ok for me with 1.38.45 with either upstream or fastcomp, in both node, chrome and firefox.

It would be quite odd for something to work on node but not chrome or firefox. It's possible, but I don't think I've seen that happen in a very long time. So I don't have a good guess as to what could be going wrong on your system, sorry.

If I were debugging something like this, I might try EMCC_AUTODEBUG=1 in the env - that will emit lots of logging at runtime, and you can diff the output from it working in node vs failing on the web.

@Beuc

This comment has been minimized.

Copy link
Contributor Author

commented Sep 13, 2019

I wouldn't be surprised if this was fixed by wasm2js changes from last week... :)

@Beuc Beuc closed this Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.