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

Fix aarch64 load trap info: HeapOutOfBounds, not OutOfBounds. #1571

Merged
merged 1 commit into from
Apr 22, 2020

Conversation

cfallin
Copy link
Member

@cfallin cfallin commented Apr 21, 2020

This halfway solves a test failure: when temporarily disabling another
assert that is triggered by lack of debug info, this causes the
custom_trap_handler test to pass.

Validated that the HeapOutOfBounds trapcode is passed to the TrapSink by the x86 backend's lowering of memory accesses as well.

This halfway solves a test failure: when temporarily disabling another
assert that is triggered by lack of debug info, this causes the
`custom_trap_handler` test to pass.
@cfallin cfallin added the cranelift:area:aarch64 Issues related to AArch64 backend. label Apr 21, 2020
@cfallin cfallin assigned cfallin and unassigned cfallin Apr 21, 2020
@github-actions github-actions bot added the cranelift Issues related to the Cranelift code generator label Apr 21, 2020
@github-actions
Copy link

Subscribe to Label Action

cc @bnjbvr

This issue or pull request has been labeled: "cranelift", "cranelift:area:aarch64"

Thus the following users have been cc'd because of the following labels:

  • bnjbvr: cranelift

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

cfallin added a commit to cfallin/wasmtime that referenced this pull request Apr 22, 2020
This change adds SourceLoc information per instruction in a `VCode<Inst>`
container, and keeps this information up-to-date across register allocation
and branch reordering. The information is initially collected during
instruction lowering, eventually collected on the MachSection, and finally
provided to the environment that wraps the codegen crate for wasmtime.

This PR is based on top of bytecodealliance#1570 and bytecodealliance#1571 (part of a series fixing tests).

This PR depends on wasmtime/regalloc.rs#50, a change to the register
allocator to provide instruction-granularity info on the rewritten
instruction stream (rather than block-granularity).

With the prior PRs applied as well, quite a few more unit tests pass;
the exclusion list in bytecodealliance#1526 should be updated if this PR lands first.
Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks! I was thinking that setting the trap at so low a layer was a bad use of abstractions, and it might actually make sense to pass the TrapCode along the SourceLoc, up above during lowering. It is a preexisting issue, though, since 1. i implemented it this way, and 2. the x86 backend does the same thing as we do here (it uses this trap code in emit functions). So either way is fine.

@cfallin
Copy link
Member Author

cfallin commented Apr 22, 2020

Agreed, we could clean up the way that traps are specified at some point -- something like "trap code to raise if this CLIF instruction fails for any one of a predetermined set of failure modes" (e.g., load/store to bad address, FP range/conversion/div-by-0, etc.) For now this fixes the test failures, though, so I'll go ahead and merge this!

@cfallin cfallin merged commit 2f1a2f4 into bytecodealliance:master Apr 22, 2020
cfallin added a commit to cfallin/wasmtime that referenced this pull request Apr 23, 2020
This change adds SourceLoc information per instruction in a `VCode<Inst>`
container, and keeps this information up-to-date across register allocation
and branch reordering. The information is initially collected during
instruction lowering, eventually collected on the MachSection, and finally
provided to the environment that wraps the codegen crate for wasmtime.

This PR is based on top of bytecodealliance#1570 and bytecodealliance#1571 (part of a series fixing tests).

This PR depends on wasmtime/regalloc.rs#50, a change to the register
allocator to provide instruction-granularity info on the rewritten
instruction stream (rather than block-granularity).

With the prior PRs applied as well, quite a few more unit tests pass;
the exclusion list in bytecodealliance#1526 should be updated if this PR lands first.
cfallin added a commit to cfallin/wasmtime that referenced this pull request Apr 24, 2020
This change adds SourceLoc information per instruction in a `VCode<Inst>`
container, and keeps this information up-to-date across register allocation
and branch reordering. The information is initially collected during
instruction lowering, eventually collected on the MachSection, and finally
provided to the environment that wraps the codegen crate for wasmtime.

This PR is based on top of bytecodealliance#1570 and bytecodealliance#1571 (part of a series fixing tests).

This PR depends on wasmtime/regalloc.rs#50, a change to the register
allocator to provide instruction-granularity info on the rewritten
instruction stream (rather than block-granularity).

With the prior PRs applied as well, quite a few more unit tests pass;
the exclusion list in bytecodealliance#1526 should be updated if this PR lands first.
@cfallin cfallin deleted the fix-aarch64-heap-oob branch May 6, 2020 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift:area:aarch64 Issues related to AArch64 backend. cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants