You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
x64: Segfaulting rip-relative load due to misalignment #4812
Local bisection points to #4730 for this issue but that seems like it may also be just as likely to expose a preexisting issue. Reproducing this is somewhat nontrivial and wasm-tools shrink was pretty unsuccessful on this test case.
$ cargo run -q \
run foo.wasm \
--wasm-features all \
--enable-cranelift-nan-canonicalization \
--wasm-timeout 20 \
-g
zsh: segmentation fault cargo run -q run $HOME/foo.wasm --wasm-features all --wasm-timeout 20 -g
Note that this reproduction is quite specific to layout of code and the various options enabled here are all required with the input wasm above.
When I run the test case I get the following output:
% cargo run -q run ./foo.wasm --wasm-features all --enable-cranelift-nan-canonicalization --wasm-timeout 20 -g
Error: failed to run main module `./foo.wasm`
Caused by:
0: failed to instantiate "./foo.wasm"
1: wasm trap: integer overflow
wasm backtrace:
0: 0x61 - <unknown>!<wasm function 1>
I thought to try your example on cee4b20 (the commit where #4730 was merged) and it did indeed segfault. Could the behavior I'm seeing on main be due to the fix for #4761 that was fixed in #4790?
According to oss-fuzz the original test case here still crashes and trying again locally I'm able to reproduce:
$ cargo run -q run --disable-cache testcase42.wasm --wasm-features all --cranelift-set wasmtime_linkopt_padding_between_functions=1
zsh: segmentation fault cargo run -q run --disable-cache testcase42.wat --wasm-features all
with testcase42.wasm.gz as an input. This is probably related to the wasmtime_linkopt_padding_between_functions option which is pretty nonstandard and only there for the fuzzers, but it may mean that there's a missing alignment calculation for when a function starts?
Activity
elliottt commentedon Aug 30, 2022
When I run the test case I get the following output:
elliottt commentedon Aug 30, 2022
I thought to try your example on cee4b20 (the commit where #4730 was merged) and it did indeed segfault. Could the behavior I'm seeing on
mainbe due to the fix for #4761 that was fixed in #4790?alexcrichton commentedon Aug 30, 2022
Oh you know it was probably something to do with
--disable-cachewhere my bisection went awry. I always forget to pass that flag, alas!In that case yeah it looks like this is fixed locally so I'll close.
alexcrichton commentedon Aug 30, 2022
According to oss-fuzz the original test case here still crashes and trying again locally I'm able to reproduce:
with testcase42.wasm.gz as an input. This is probably related to the
wasmtime_linkopt_padding_between_functionsoption which is pretty nonstandard and only there for the fuzzers, but it may mean that there's a missing alignment calculation for when a function starts?alexcrichton commentedon Aug 30, 2022
Oh and to log, the reproduction for me locally is on 1a59b3e which should be
mainas of this writingelliottt commentedon Aug 30, 2022
It's definitely coming from the
fcopysignlowering:Align functions according to their ISA's requirements (#4826)