binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

wasm-opt segmentation fault with, but not with --debug

Open mkarup opened this issue 1 year ago • 1 comments

I have a binary wasm file demo1 (zipped here). If I use the binary of binaryen/ wasm-opt available on the releases page, version 117, and I call

wasm-opt -O2 --enable-tail-call --enable-reference-types --enable-gc --enable-mutable-globals -o demo1-opt_O2.wasm demo1

I get a segfault:

Segmentation fault (core dumped)

The same happens for -O3, but not with O1. If I add the --debug flag to the when doing -O2 or -O3, the command succeeds and optimizes the binary.

If I build binaryen/ wasm-opt from source, I don't get any segmentation faults.

mkarup avatar May 20 '24 06:05 mkarup

I see the same thing: 117 release segfaults. Building 117 from source works, and building tip of tree also works. So this might be a compiler issue in the release somehow. Very odd. I'm not sure what is a good way to debug that.

kripken avatar May 20 '24 17:05 kripken

Closing this because it's not reproducible in a way that would let us fix anything. Please reopen or file new issues if later releases have similar issues, though.

tlively avatar Dec 13 '24 20:12 tlively