alexcrichton opened PR #6776 from alexcrichton:trap-on-misalignment
to bytecodealliance:main
:
Previously Wasmtime would return
EINVAL
to a guest but the upstream documentation indicates that misaligned pointers should trap, so this commit updates the alignment error to get converted into a trap rather than than being returned to the guest.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested wasmtime-core-reviewers for a review on PR #6776.
alexcrichton requested pchickey for a review on PR #6776.
pchickey submitted PR review:
I merged the pointer out of bounds changes upstream, so you can also change the
PtrOutOfBounds
andPtrOverflow
cases to trap.The new preview 1 implementation inside wasi/src/preview2/preview1 should also be updated as well. Unfortunately, it looks like instead of using a From<GuestError> impl there, it instead uses a pattern of Result<_, GuestError>::or(Err(Errno::Inval)) at each call site, so that is a tougher job. Its OK to not take that on as part of this PR, but we should file an issue on it if you want to defer it.
alexcrichton updated PR #6776.
alexcrichton updated PR #6776.
alexcrichton updated PR #6776.
pchickey submitted PR review.
pchickey merged PR #6776.
Last updated: Dec 23 2024 at 12:05 UTC