Closed jdgordon closed 1 year ago
Hey @jdgordon,
We're aware of this issue and have started fixing it in some spots but we haven't gotten to this code yet. Let me see if I can find the right person to take a look at this and decide if we want to move to go.uber.com/atomic
for this code as well.
Thanks! We're standardizing on go.uber.org/atomic for the datadog-agent itself, so it would make sense to do the same here. It should be an easy change to this PR.
We've hit this issue in production and will have to use this fork for now.
Thanks for your patience with this. @knusbaum has a PR out now that should fix the issue for you. There are just a few more changes that need to happen on that PR before it can be merged.
The fix for this issue was merged and released in 1.42.0. I'm going to close this now, but thank you for the contribution.
I'm not sure if this is a bug in the go compiler, or if this struct is being embedded somewhere which is breaking alignment rules, but on ARM atomic access to the nbContext field causes a panic due to unaligned access. Switching to a pointer ensures it will always be correctly aligned.
I have been running this branch on my device for the last 2 weeks without any other issues.