Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Aborted (core dumped)" while executing wasm file #4105

Open
luxinyi0105 opened this issue Jul 25, 2023 · 2 comments
Open

"Aborted (core dumped)" while executing wasm file #4105

luxinyi0105 opened this issue Jul 25, 2023 · 2 comments
Assignees
Labels
bug Something isn't working 🕵️ needs investigation The issue/PR needs further investigation priority-high High priority issue

Comments

@luxinyi0105
Copy link

luxinyi0105 commented Jul 25, 2023

Describe the bug

While executing the given wasm file, wasmer outputs "Aborted (core dumped)", although the correct checksum result is also provided.
All three compiler backends(Singlepass, Cranelift, LLVM) will discover the problem.

$ wasmer -vV
wasmer 4.0.0 (6ccf29d 2023-07-24)
binary: wasmer-cli
commit-hash: 6ccf29df1ebab40b3e3e7676ceac7f9deab9a8a3
commit-date: 2023-07-24
host: x86_64-unknown-linux-gnu
compiler: singlepass,cranelift,llvm
$ rustc -vV
rustc 1.73.0-nightly (0308df23e 2023-07-21)
binary: rustc
commit-hash: 0308df23e621e783e31a27ca5beaa01b9df60d4a
commit-date: 2023-07-21
host: x86_64-unknown-linux-gnu
release: 1.73.0-nightly
LLVM version: 16.0.5

Steps to reproduce

TestCase.zip

$ wasmer run --singlepass testcase_1.wasm

You can replace "--singlepass" with "--cranelift" or "--llvm", this will get the same result.

Expected behavior

$ wasmer run --singlepass testcase_1.wasm
checksum = DAFC642C

The expected result maybe something like above, just outputs the correct checksum result, or trigger wasmer's exception handling.

Actual behavior

$ wasmer run --singlepass testcase_1.wasm
checksum = DAFC642C
thread '<unnamed>' panicked at 'misaligned pointer dereference: address must be a multiple of 0x4 but is 0x7f36643857f9', /home/oscar/Software/wasmer/lib/api/src/sys/mem_access.rs:63:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread caused non-unwinding panic. aborting.
Aborted (core dumped)

Additional context

Actually, I don't know what the correct result of the test case should look like, either.

So I used some other WebAssembly runtimes, such as wasmedge and wasm-micro-runtime(WAMR), to execute the same test case, they output the correct checksum result without "Aborted (core dumped)".

@Michael-F-Bryan
Copy link
Contributor

This may be similar to #4072.

@Michael-F-Bryan Michael-F-Bryan added bug Something isn't working 🕵️ needs investigation The issue/PR needs further investigation priority-high High priority issue labels Aug 1, 2023
@sug0
Copy link

sug0 commented Aug 3, 2023

near/wasmer@62546cc
potentially fixed by this commit

the dereferenced pointer is not even aligned to a power of two, in this issue, so I doubt it is related to #4072

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🕵️ needs investigation The issue/PR needs further investigation priority-high High priority issue
Projects
None yet
Development

No branches or pull requests

4 participants