-
Notifications
You must be signed in to change notification settings - Fork 745
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
asm2wasm crah #60
Comments
Perhaps try to escape your code with 4-backticks (`) before and after? |
It seems that the "for loop" syntax is not handled in "parseAfterKeyword" (in parse.h file) for (i0 = 0; (((i0 | 0) < 2) | 0); i0 = (((i0 | 0) + 1) | 0)) { |
Ok, that makes sense. We have support for parsing emscripten asm.js output, which is a subset of asm.js - it never uses for loops, for example. It should be easy to add this support though, if it would be useful. |
Well, our code backend currently generates "for loop" yes. |
Ah, out of curiosity, what code backend is this? |
FAUST (Functional Audio Stream) functional programming language specifically designed for real-time audio signal processing and synthesis (see http://faust.grame.fr) |
Interesting, thanks for the info. Ok, I just added for-loop support. I didn't test it beyond a simple testcase (see the commit), so let me know if you hit any issues |
Working now, thanks! |
Great, thanks for confirming. |
Well I found later on that the following generated JS code is not parsed correctly. Any chance it could also be fixed? function getJSONmydsp() { |
That doesn't look like valid asm.js? It doesn't have arrays or strings. Btw, please use escaping (4 backticks "`") to make code easier to read. |
OK, this is additional pure JS code that our backend adds with the asm.js module. We can live without that� Thanks. Le 5 janv. 2016 � 18:25, Alon Zakai notifications@github.com a �crit :
|
Crash with the following command :
bin/asm2wasm noise.js
for:
(i0 = 0; (((i0 | 0) < 2) | 0); i0 = (((i0 | 0) + 1) | 0)) {
HEAP32[dsp + 0 + ((i0 | 0) << 2) >> 2] = 0;
Abort trap: 6
Noise.js file content is :
/* ------------------------------------------------------------
author: "Grame"
copyright: "(c)GRAME 2009"
license: "BSD"
name: "Noise"
version: "1.1"
Code generated with Faust 2.0.a41 (http://faust.grame.fr)
------------------------------------------------------------ */
function mydspModule(global, foreign, buffer) {
}
function getSizemydsp() {
return 16;
}
function getPathTablemydsp() {
}
function getJSONmydsp() {
return "{ "name": "Noise", "outputs": "1", "meta": [ { "author": "Grame" }, { "copyright": "(c)GRAME 2009" }, { "license": "BSD" }, { "name": "Noise" }, { "version": "1.1" } ], "ui": [ { "type": "vgroup", "label": "0x00", "items": [ { "type": "vslider", "label": "Volume", "address": "/0x00/Volume", "meta": [ { "style": "knob" } ], "init": "0", "min": "0", "max": "1", "step": "0.1" } ] } ] } ";
}
function metadatamydsp(m) {
m.declare("author", "Grame");
m.declare("copyright", "(c)GRAME 2009");
m.declare("license", "BSD");
m.declare("name", "Noise");
m.declare("version", "1.1");
}
Crash log is :
bt
__pthread_kill + 10 frame #1: 0x00007fff8cdd835c libsystem_pthread.dylib
pthread_kill + 92frame We need a proper build system #2: 0x00007fff858e3b1a libsystem_c.dylib
abort + 125 frame #3: 0x000000010000f04f asm2wasm
cashew::Parser<cashew::Ref, cashew::DotZeroValueBuilder>::parseAfterKeyword(cashew::Parser<cashew::Ref, cashew::DotZeroValueBuilder>::Frag&, char_&, char const_) + 575frame Memory size from emcc #4: 0x000000010000e8df asm2wasm
cashew::Parser<cashew::Ref, cashew::DotZeroValueBuilder>::parseElement(char*&, char const*) + 335 frame #5: 0x000000010000e481 asm2wasm
cashew::Parser<cashew::Ref, cashew::DotZeroValueBuilder>::parseElementOrStatement(char_&, char const_) + 577frame How to convert imported variables? #6: 0x000000010000e0df asm2wasm
cashew::Parser<cashew::Ref, cashew::DotZeroValueBuilder>::parseBlock(char*&, char const*, cashew::IString, cashew::IString) + 463 frame #7: 0x0000000100012eff asm2wasm
cashew::Parser<cashew::Ref, cashew::DotZeroValueBuilder>::parseBracketedBlock(char_&) + 287frame Fix missing override warning. #8: 0x000000010001350a asm2wasm
cashew::Parser<cashew::Ref, cashew::DotZeroValueBuilder>::parseFunction(char_&, char const_) + 922 frame #9: 0x000000010000e8df asm2wasm
cashew::Parser<cashew::Ref, cashew::DotZeroValueBuilder>::parseElement(char_&, char const_) + 335frame Mysterious intermittent error #10: 0x000000010000e481 asm2wasm
cashew::Parser<cashew::Ref, cashew::DotZeroValueBuilder>::parseElementOrStatement(char_&, char const_) + 577 frame #11: 0x000000010000e0df asm2wasm
cashew::Parser<cashew::Ref, cashew::DotZeroValueBuilder>::parseBlock(char_&, char const_, cashew::IString, cashew::IString) + 463frame fix typo in readme #12: 0x0000000100012eff asm2wasm
cashew::Parser<cashew::Ref, cashew::DotZeroValueBuilder>::parseBracketedBlock(char_&) + 287 frame #13: 0x000000010001350a asm2wasm
cashew::Parser<cashew::Ref, cashew::DotZeroValueBuilder>::parseFunction(char*&, char const*) + 922frame Warning due to uninitialized value #14: 0x000000010000e8df asm2wasm
cashew::Parser<cashew::Ref, cashew::DotZeroValueBuilder>::parseElement(char_&, char const_) + 335 frame #15: 0x000000010000e481 asm2wasm
cashew::Parser<cashew::Ref, cashew::DotZeroValueBuilder>::parseElementOrStatement(char*&, char const*) + 577frame Spec test fail on unoptimized build #16: 0x000000010000e0df asm2wasm
cashew::Parser<cashew::Ref, cashew::DotZeroValueBuilder>::parseBlock(char_&, char const_, cashew::IString, cashew::IString) + 463 frame #17: 0x000000010000485f asm2wasm
main + 463frame Sort the local variable order with the most frequently referenced first. #18: 0x00007fff8fcc15fd libdyld.dylib`start + 1
The text was updated successfully, but these errors were encountered: