diff options
| author | Michael Anthony Knyszek <mknyszek@google.com> | 2025-05-20 20:26:56 +0000 |
|---|---|---|
| committer | Michael Knyszek <mknyszek@google.com> | 2025-05-21 09:50:31 -0700 |
| commit | 8b45a3f78b178ce66f419038a664cbd6a82ada54 (patch) | |
| tree | 62d8244f9bde2554525137724cab46a137b32b54 /src/syscall/exec_linux.go | |
| parent | 896097000912761dbd31cead2bec99f17534f521 (diff) | |
| download | go-8b45a3f78b178ce66f419038a664cbd6a82ada54.tar.xz | |
runtime: guarantee checkfinalizers test allocates in a shared tiny block
Currently the checkfinalizers test (TestDetectCleanupOrFinalizerLeak)
only *tries* to ensure the tiny alloc with a cleanup attached shares a
block with other objects. However, what it does is insufficient, because
it could get unlucky and have the last object allocated be the first
object of a new block.
This change changes the test to guarantee that a tiny object is not at
the start of a fresh block by looking at the alignment of the object's
pointer. If the object's pointer is odd, then that's good enough to know
that it shares a block with something else, since the blocks themselves
are aligned to a much higher power of two.
This fixes a failure I've seen on the builders.
Fixes #73810.
Change-Id: Ieafdbb9cccb0d2dc3659a9a5d9d9233718461635
Reviewed-on: https://go-review.googlesource.com/c/go/+/674655
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/syscall/exec_linux.go')
0 files changed, 0 insertions, 0 deletions
