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 unaligned access #887

Merged
merged 5 commits into from
Aug 7, 2023
Merged

Fix unaligned access #887

merged 5 commits into from
Aug 7, 2023

Conversation

wks
Copy link
Collaborator

@wks wks commented Aug 4, 2023

align_offset_alloc and related functions now use ptr::{read,write}_unaligned to access the prepended address.

When calculating the address or offset of metadata, we ensure its address or offset is at least word-aligned.

Fixes: #886
Fixes: #888

@wks wks requested a review from qinsoon August 4, 2023 06:01
@wks wks mentioned this pull request Aug 5, 2023
Copy link
Member

@qinsoon qinsoon left a comment

Choose a reason for hiding this comment

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

LGTM.

I think we probably would like to keep #886 open, as this PR is just a workaround for the issue.

@qinsoon qinsoon added the PR-testing Run binding tests for the pull request (deprecated: use PR-extended-testing instead) label Aug 5, 2023
@wks wks merged commit 4c1e58a into mmtk:master Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-testing Run binding tests for the pull request (deprecated: use PR-extended-testing instead)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Misaligned access in align_offset_alloc Misaligned metadata
2 participants