var wg sync.WaitGroup

func TestWaitGroupGlobal(t *testing.T) {
        synctest.Run(func() {
                wg.Go(func() {})
                wg.Wait()
        })
}
fatal error: getOrSetBubbleSpecial on invalid pointer

The problem is that wg isn't in any span, and we can only associate specials with objects in spans.

Comment From: gopherbot

Change https://go.dev/cl/679695 mentions this issue: testing/synctest, runtime: avoid panic when using linker-alloc WG from bubble

Comment From: gabyhelp

Related Code Changes

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)