yurydelendik / wasmception

Minimal C/C++ language toolset for building wasm files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash when printf-ing a float != 0

Jiboo opened this issue · 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.

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.