wasmception icon indicating copy to clipboard operation
wasmception copied to clipboard

Crash when printf-ing a float != 0

Open Jiboo opened this issue 6 years ago • 1 comments

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-debug though.
  • 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.

Jiboo avatar Feb 02 '19 19:02 Jiboo

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.

yurydelendik avatar Feb 04 '19 15:02 yurydelendik