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

core/rawdb, eth/downloader: align 64bit atomic fields #19591

Merged
merged 1 commit into from
May 16, 2019

Conversation

karalabe
Copy link
Member

The freezer and the downloader contain a few atomic uint64 fields. Fun fact:

On ARM, x86-32, and 32-bit MIPS, it is the caller's responsibility to arrange for 64-bit alignment of 64-bit words accessed atomically. The first word in a variable or in an allocated struct, array, or slice can be relied upon to be 64-bit aligned. https://golang.org/pkg/sync/atomic/#pkg-note-BUG

This PR moves the atomics in the freezer and downloader to the head of the struct to ensure 64bit alignment.

Fixes #19590.

@karalabe karalabe requested a review from holiman as a code owner May 16, 2019 22:48
@karalabe karalabe added this to the 1.9.0 milestone May 16, 2019
@karalabe karalabe merged commit 2f855bf into ethereum:master May 16, 2019
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.

geth crash with [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x23e04]
1 participant