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

Added proper definition of ucontext for macos/aarch64 to avoid unaligned issue #4120

Merged
merged 4 commits into from
Aug 3, 2023

Conversation

ptitSeb
Copy link
Contributor

@ptitSeb ptitSeb commented Aug 2, 2023

Added proper definition of ucontext for macos/aarch64 to avoid unaligned issue

For #4072

@ptitSeb ptitSeb requested a review from syrusakbary as a code owner August 2, 2023 16:48
Copy link

@sug0 sug0 left a comment

Choose a reason for hiding this comment

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

Some of my team mates at @heliaxdev have suggested that a better fix might be to invoke read_unaligned, which does not check for the alignment of the ucontext pointer. If we implemented a fix based on read_unaligned, we would not need to redefine ucontext_t for different platforms/architectures. Once I have some disposable time to work on this issue again, I'll investigate this possibility. That said, otherwise, lgtm.

lib/vm/src/trap/traphandlers.rs Outdated Show resolved Hide resolved
@ptitSeb
Copy link
Contributor Author

ptitSeb commented Aug 3, 2023

Some of my team mates at @heliaxdev have suggested that a better fix might be to invoke read_unaligned, which does not check for the alignment of the ucontext pointer. If we implemented a fix based on read_unaligned, we would not need to redefine ucontext_t for different platforms/architectures. Once I have some disposable time to work on this issue again, I'll investigate this possibility. That said, otherwise, lgtm.

Well, I think I'll merge this fix for now then. If you get a better fix with read unaligned, feel free to do a PR with it.

@ptitSeb ptitSeb merged commit 79e92a7 into master Aug 3, 2023
@ptitSeb ptitSeb deleted the fix_macos_aarch64_ucontext branch August 3, 2023 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants