Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

writer: ensure 64bit alignment on 32bit systems #412

Merged
merged 1 commit into from
Apr 13, 2018
Merged

Conversation

gq0
Copy link

@gq0 gq0 commented Apr 12, 2018

While letting the trace-agent run on an ARMv7 system (32bit), I encounter some segmentation faults with atomic operations. This is a familiar issue in go, please see https://golang.org/pkg/sync/atomic/#pkg-note-BUG

To fix this, I moved the structs containing the values to be written atomically to the top of the parent struct to ensure that they are 64bit aligned. See link above

The first word in a variable or in an allocated struct, array, or slice can be relied upon to be 64-bit aligned.

Copy link
Contributor

@gbbr gbbr left a comment

Choose a reason for hiding this comment

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

Well done! Thanks for this.

@gbbr gbbr merged commit bc5913c into DataDog:master Apr 13, 2018
@gbbr gbbr added this to the 6.2.0 milestone Apr 13, 2018
@palazzem palazzem added the bug label Apr 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants