-
Notifications
You must be signed in to change notification settings - Fork 699
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
Runtime Error #10
Comments
I have a few colleagues who have seen the same thing. The solution is not entirely clear to me but @mbodart found that if you forced the definition of YY_INITIAL_VALUE to actually initialize things instead of maybe not doing it; then it seemed to work. I have not confirmed this since I don't have an issue. Maybe another solution is to regenerate the wasm-parser.c file that seems to be a problem but I tried to do that and my bison is not recent enough it seems (it fails). |
I tried with bison 3.0.4. And it does not work. |
I compiled and ran successfully on an ubuntu VM. The error still occurs on the host OS (Arch). I'm betting it has to do with the bison version |
I tried it on a file and just got a bunch of (expected) errors. How did you generate test.wasm? |
Same problem here. Bison 3.0.2, gcc 4.9.2. Workaround noted by @jcbeyler above works. |
I started with the small example in README.md (which is perhaps out of date). (module The failure seems to be reproducible in a "known good" environment, if I simply A quick run with valgrind points to problems in the vector append operations, e.g. ==21318== Conditional jump or move depends on uninitialised value(s) which suggests these module-level vectors are not initialized with null values Perhaps wasm-parser.y needs another surgically placed ZEROMEM? |
Indeed, it seems the wasm-parser.y rule for module: module : needs a ZEROMEM($$); That fixed this issue for me. |
Ah, interesting. I've been running with clang's memory sanitizer, so I assume it would have caught a bug like this, but it seems not to have. Thanks for the fix! |
* Adds fields supporting no-sandbox mode to IR module. This change adds fields that represent relocation information for function- and data pointers (both within code as well as within static initializers) and mappings from pointers to relevant indices. Relocation info can be 32-bit or 64-bit, but depending on the selected memory model only one of these sets should ever be non-empty. There are two pointer-to-index mappings: Function pointers: WASM-style function pointers (integer constants that refer to entries in the indirect function table) are mapped to the corresponding index of the function in question. The index lets us find the relevant entry in module_->funcs. Data pointers: WASM-style data pointers pointing at the LAST byte of a piece of global data are mapped to the corresponding index of the DataSegment in question, making it possible to find the relevant entry in module_->data_segments. By using the last byte it becomes possible to use C++ std::map::lower_bound on any address within the range of addresses of a given data segment in order to obtain the index of that segment. binary-reader-ir.cc is modified to populate these fields accordingly. The offset of element- and data segments is assumed to be given by a single ixx.const instruction. * Uses symbol table information to interpret reloc info. * Unconditionally store data segment index. * Moves validity check of symbol up. This rearranges some of the logic in On{Function,Data}Symbol so that the function index or the data segment index gets validated before being stored in the symbol->index map.
This happens when given any *.wasm file
The text was updated successfully, but these errors were encountered: