wasmception
wasmception copied to clipboard
Crash when printf-ing a float != 0
Hello,
I get a crash, with what seems to be a stack-overflow of frexpl.
Steps to reproduce with the example:
- Add syscalls from wasmimp.js in index.html imports
- Increase __indirect_function_table initial
- Add
printf("%f\n", (float)a);in main.c do_something.
Side notes:
- I know this is not a wasmception bug, although I have no idea where it could be from. Is there any way to build musl with debug info, so that the bug might be more debuggable? Musl seems already configured with
--enable-debugthough. - I can reproduce it with Chrome 69, Firefox 65 and my toy jit.
- Changing the arg do_something to 0 in js code fixes the crash and it is correctly printed (although it crashes later in Chrome/Firefox because the writev syscall isn't implemented).
Bye, JB.
Is there any way to build musl with debug info, so that the bug might be more debuggable?
The -g option will work in clang. Though there are more steps is needed to adjust paths to original sources and generate a proper source map to be consumable with browsers debuggers.