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 context switch #3498

Conversation

ysbaddaden
Copy link
Contributor

Fiber context switch fails on AArch64 with a SIGBUS error. It's caused by the stack being incorrectly aligned. Pushing any other register to th stack fixes the issue.

It's also impossible to read a pointer value directly into the SP register, so this patch avoids the pointer for the second argument altogether. The same could be applied for all platforms.

Fiber context switch fails on AArch64 with a SIGBUS error. It's
caused by the stack being incorrectly aligned. Pushing any other
register to th stack fixes the issue.

It's also impossible to read a pointer value directly into the SP
register, so this patch avoids the pointer for the second argument
altogether. The same could be applied for all platforms.
@ysbaddaden ysbaddaden merged commit 00a9a8a into crystal-lang:master Nov 4, 2016
@ysbaddaden ysbaddaden deleted the fix-aarch64-context-switch-alignment branch November 4, 2016 12:22
firejox pushed a commit to firejox/crystal that referenced this pull request Dec 12, 2016
Fiber context switch fails on AArch64 with a SIGBUS error. It's
caused by the stack being incorrectly aligned. Pushing any other
register to th stack fixes the issue.

It's also impossible to read a pointer value directly into the SP
register, so this patch avoids the pointer for the second argument
altogether. The same could be applied for all platforms.
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.

None yet

1 participant