Memory alignment errors with the stack_restore
and stack_checkpoint
syscalls
#4284
Labels
bug
Something isn't working
📦 lib-wasi
About wasmer-wasi
🕵️ needs investigation
The issue/PR needs further investigation
priority-high
High priority issue
Milestone
Describe the bug
Programs trigger memory alignment errors when working with the
stack_restore()
andstack_checkpoint()
syscalls.Steps to reproduce
The easiest way to reproduce this is using the
sharrattj/dash
package.(note
$
is the host machine and#
is from the Dash shell)If you run
wasmer run
with$RUST_LOG
set towasmer_wasix::syscalls=debug
, this log message jumps out as suspicious:Here is the code emitting that log message and returning an error from the syscall:
wasmer/lib/wasix/src/syscalls/wasix/stack_restore.rs
Lines 20 to 29 in 7cb550d
Additional context
As part of #4192 we've switched the
WasiRunner
over to usingwasmer_wasix::bin_factory::exec::spawn_exec()
for running WASIX programs instead of doingWasiEnvBuilder::run()
. After this change, several snapshot tests and the (previously ignored)os::console::tests::test_console_dash_tty_with_args_and_env
test have started failing, saying the process completed with an exit code of 78 (memory violation) rather than the expected value.I've been able to reproduce this error on Wasmer 4.2.2, which means it isn't related to the changes in
WasiRunner
.For context, see the conversations on Slack about exit codes and a previous conversation about unaligned pointers being passed to
stack_checkpoint
.I've also only seen issues with the
sharrattj/dash
package, so this may be a bug in the package rather than our WASIX implementation.The text was updated successfully, but these errors were encountered: