]> Cypherpunks repositories - gostls13.git/commit
testing/synctest, runtime: avoid panic when using linker-alloc WG from bubble
authorDamien Neil <dneil@google.com>
Thu, 5 Jun 2025 20:47:06 +0000 (13:47 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 10 Jun 2025 22:02:26 +0000 (15:02 -0700)
commit4f86f2267167a63b673c4a2a2994e008b32c90ea
tree24dd8afd3e0e54897f199a95a151ccd5be83fab7
parent773701a853a3105696c59c2b92b2eff35e0e055b
testing/synctest, runtime: avoid panic when using linker-alloc WG from bubble

We associate WaitGroups with synctest bubbles by attaching a
special to the WaitGroup. It is not possible to attach a special
to a linker-allocated value, such as:

    var wg sync.WaitGroup

Avoid panicking when accessing a linker-allocated WaitGroup
from a bubble. We have no way to associate these WaitGroups
with a bubble, so just treat them as always unbubbled.
This is probably fine, since the WaitGroup was always
created outside the bubble in this case.

Fixes #74005

Change-Id: Ic71514b0b8d0cecd62e45cc929ffcbeb16f54a55
Reviewed-on: https://go-review.googlesource.com/c/go/+/679695
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/internal/synctest/synctest.go
src/internal/synctest/synctest_test.go
src/runtime/export_test.go
src/runtime/synctest.go
src/runtime/synctest_test.go
src/sync/waitgroup.go
src/testing/synctest/synctest.go