]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: align m.procid to 8 bytes on 32-bit systems
authorKeith Randall <khr@golang.org>
Mon, 11 Apr 2022 21:56:11 +0000 (14:56 -0700)
committerKeith Randall <khr@google.com>
Mon, 11 Apr 2022 22:49:56 +0000 (22:49 +0000)
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.

Change-Id: Ida27b23068b3cc7208fce3c97b69a464ccf68209
Reviewed-on: https://go-review.googlesource.com/c/go/+/399754
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
src/runtime/runtime2.go

index b903cc80111029af1896da593dab9a6e33d77948..b2c42d0e5c1202db6922aebf484111ad790461d4 100644 (file)
@@ -516,6 +516,7 @@ type m struct {
        g0      *g     // goroutine with scheduling stack
        morebuf gobuf  // gobuf arg to morestack
        divmod  uint32 // div/mod denominator for arm - known to liblink
+       _       uint32 // align next field to 8 bytes
 
        // Fields not known to debuggers.
        procid        uint64            // for debuggers, but offset not hard-coded