-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
runtime: doAllThreadsSyscall has an unaligned atomic load on 32-bit architectures #51776
Comments
Oh, I should also mention, these loads are the only atomic accesses of this field. |
|
We also suspect this isn't actually failing on the builders because cgo needs to be disabled for the test that checks this codepath, and the only nocgo builder for Linux is linux/amd64 (nothing 32-bit). |
cc @golang/release re @mknyszek's note that we have no nocgo coverage outside of amd64. |
Ack. If it's deemed helpful, adding a 32-bit nocgo builder using any of our virtualized VM-based host types, e.g., |
Potentially relevant is #50860, since those atomic types would let us fix these alignment issues.
I believe you are right that this is new in 1.18. |
Fixed in https://go.dev/cl/399754. @gopherbot Please backport to 1.18. This is a regression with no workaround. |
Backport issue(s) opened: #52305 (for 1.18). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
Change https://go.dev/cl/399954 mentions this issue: |
Change https://go.dev/cl/399955 mentions this issue: |
…systems https://go-review.googlesource.com/c/go/+/383434 started using atomic Load64 on this field, which breaks 32 bit platforms which require 64-bit alignment of uint64s that are passed to atomic operations. Not sure why this doesn't break everywhere, but I saw it break on my laptop during all.bash. For #51776. Fixes #52305. Change-Id: Ida27b23068b3cc7208fce3c97b69a464ccf68209 Reviewed-on: https://go-review.googlesource.com/c/go/+/399754 Run-TryBot: Keith Randall <[email protected]> Reviewed-by: Michael Pratt <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Keith Randall <[email protected]> (cherry-picked from commit ea7e3e3) Reviewed-on: https://go-review.googlesource.com/c/go/+/399954 Run-TryBot: Michael Pratt <[email protected]>
Even without builder coverage, we could at least have some coverage that all fields in the runtime that are accessed as 64-bit atomics all have correct offsets for a handful of varied build contexts? |
For tailscale/go@bb6009e (The cherry-picked fix for golang/go#51776) Change-Id: Ib4a67c0f82256c62989fbba2cc9c15b728313ebd Signed-off-by: Brad Fitzpatrick <[email protected]>
For tailscale/go@bb6009e (The cherry-picked fix for golang/go#51776) Change-Id: Ib4a67c0f82256c62989fbba2cc9c15b728313ebd Signed-off-by: Brad Fitzpatrick <[email protected]>
Does procid really need to be 64-bit? I think it is the tid (thread ID), which is 32-bit on many platforms. Where do we really need 64-bit procid? |
I asked @prattmic the same thing: it's because on some OSes (any OS that uses Though, we could maybe just make it a |
@mknyszek Is there anything left to do here? This issue is currently in the 1.19 milestone. Thanks. |
I believe this is now fixed. |
The 64-bit loads here and here are unaligned on 32-bit architectures (see #599).
I would just fix this, but it's unclear to me what the right fix is. This is right at the top of the
m
struct, so adding padding is tricky because there could be other 64-bit loads below in the struct that will become unaligned. (I think maybefastrand
? I didn't check, maybe there isn't any.) Simultaneously, making these loads not atomic seems slightly dangerous on weak memory architectures.This might need a backport to Go 1.18? I think these lines are new in Go 1.18.
CC @prattmic @aclements
The text was updated successfully, but these errors were encountered: