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
An addition with overflow make lightbeam to panic when compiled in debug mode.
Note: This issue is similar to #738. I suspect other overflows like those ones to be in the code.
Overflowed values are then provided to dynasm, meaning that in release mode, Lightbeam will generate Assembly code that will try to access invalid memory address (like 0x0, kernel address, etc.) leading to different errors/panics.
$ ./target/debug/debug_lightbeam load_add_overflow_lightbeam.wasm
thread 'main' panicked at 'attempt to add with overflow', XXX/wasmtime/crates/lightbeam/src/backend.rs:1934:106
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
This issue is related to the macro load! when dealing with the i32.load16_s opcode:
pventuzelo
changed the title
[lightbeam] panic during add overflow in backend:load macro (compiled in debug)
[lightbeam] add overflow in debug mode (backend:load:1934)
Jan 17, 2020
$ debug_diff_compile panic_add_overflow_1957.wasm
thread 'main' panicked at 'attempt to add with overflow', wasmtime/crates/lightbeam/src/backend.rs:1957:90
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
pventuzelo
changed the title
[lightbeam] add overflow in debug mode (backend:load:1934)
[lightbeam] add overflow in debug mode (backend:load:1934 & backend:load:1957)
Jan 17, 2020
Issue description
An addition with overflow make lightbeam to panic when compiled in debug mode.
Note: This issue is similar to #738. I suspect other overflows like those ones to be in the code.
Overflowed values are then provided to dynasm, meaning that in release mode, Lightbeam will generate Assembly code that will try to access invalid memory address (like 0x0, kernel address, etc.) leading to different errors/panics.
This issue is related to the macro
load!
when dealing with thei32.load16_s
opcode:wasmtime/crates/lightbeam/src/backend.rs
Lines 1932 to 1935 in 420dcd7
Reproduction
Download:
load_add_overflow_lightbeam.zip
or
wasm2wat load_add_overflow_lightbeam.wasm
:Testing program (need to be compiled in debug mode i.e.
RUSTFLAGS=-g cargo build
):wasmtime commit: 420dcd7
The text was updated successfully, but these errors were encountered: