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: make sure atomic 64bit fields are 64bit aligned #5794

Merged
merged 1 commit into from
Mar 25, 2021

Conversation

Stebalien
Copy link
Member

Otherwise, this won't work on 32bit ARM.

See https://golang.org/pkg/sync/atomic/#pkg-note-BUG

Otherwise, this won't work on 32bit ARM.
@Stebalien
Copy link
Member Author

Or we can just fix #5795.

Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

Yeah, not sure how much we save by not using a RWMutex, it seems like the cleaner solution

We should also review other uses of atomics in the codebase (maybe check if there are any linters which could detect this)

@ribasushi
Copy link
Collaborator

@Stebalien afaik filecoin-ffi has a hard-dependency on 64bit instruction sets, so this is moot in the context of lotus

@magik6k magik6k merged commit 5f80869 into master Mar 25, 2021
@magik6k magik6k deleted the fix/atomic-first branch March 25, 2021 12:30
@Stebalien
Copy link
Member Author

TL;DR: There's no reason not to fix this. While we never plan on supporting 32bit platforms, someone else might come along and do that.

Alternatively, someone might try to create a proof-less "lotus lite", extract this code into a separate package, fork, etc.

@magik6k magik6k mentioned this pull request Apr 13, 2021
69 tasks
@yhio
Copy link
Contributor

yhio commented May 20, 2021

Yeah, not sure how much we save by not using a RWMutex, it seems like the cleaner solution

We should also review other uses of atomics in the codebase (maybe check if there are any linters which could detect this)

There are many uses of atomics in the codebase.

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.

4 participants