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

Panics on misaligned struct fields on ARM 32 bit #358

Closed
nkryuchkov opened this issue May 13, 2020 · 2 comments
Closed

Panics on misaligned struct fields on ARM 32 bit #358

nkryuchkov opened this issue May 13, 2020 · 2 comments
Assignees
Labels
bug Something isn't working on hold Put on hold until a specific event

Comments

@nkryuchkov
Copy link
Contributor

Describe the bug
I got a nil pointer dereferencing runtime panic on RPi because of atomic.LoadUint64 on a struct field not aligned by 8 bytes. We need to think about a way how we can check and avoid such panics.

Environment information:

  • Platform: ARM 32 bit

Steps to Reproduce
Steps to reproduce the behavior:

  1. Call atomic.LoadUint64 on a struct field not aligned by 8 bytes.

Actual behavior
Calling atomic.LoadUint64 on a struct field not aligned by 8 bytes causes panic.

Expected behavior
Calling atomic.LoadUint64 on any struct field not aligned by 8 bytes doesn't cause panic.

Additional context
This is a well-known behavior. We need to create a way of checking if all struct fields are correctly aligned. This issue also affects the dmsg repository.

@nkryuchkov nkryuchkov added the bug Something isn't working label May 13, 2020
@nkryuchkov
Copy link
Contributor Author

Adding ARM 32-bit builds to TravisCI may help to detect the panics.

@nkryuchkov nkryuchkov self-assigned this Jul 13, 2020
@nkryuchkov
Copy link
Contributor Author

Adding ARM32 builds to .travis.yml didn't help, TravisCI doesn't support them. Adding ARM64 works, however, doesn't help much as it behaves the same as AMD64, panics occur on ARM32 only. I tried to set up a Docker container with emulation of ARM32 using QEMU and with Golang for ARM32. However, it trows segfaults on almost all commands. And the speed doesn't look good.

The best option would be to wait until TravisCI supports ARM32 builds.

@nkryuchkov nkryuchkov added the on hold Put on hold until a specific event label Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working on hold Put on hold until a specific event
Projects
None yet
Development

No branches or pull requests

2 participants