go: weak: TestIssue69210 failures
#!watchflakes
default <- pkg == "weak" && test == "TestIssue69210"
Issue created automatically to collect these failures.
Example (log):
=== RUN TestIssue69210
runtime: marked free object in span 0x7b8257a312b0, elemsize=16 freeindex=0 (bad use of unsafe.Pointer or having race conditions? try -d=checkptr or -race)
0xc000014000 alloc marked
0xc000014010 alloc marked
0xc000014020 alloc marked
0xc000014030 alloc marked
0xc000014040 alloc marked
0xc000014050 alloc marked
0xc000014060 alloc marked
0xc000014070 alloc marked
...
fatal error: found pointer to free object
goroutine 35 gp=0xc0000f6c40 m=12 mp=0xc000120008 [running]:
runtime.throw({0x63fe18?, 0xc000014440?})
/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/panic.go:1099 +0x48 fp=0xc000075d20 sp=0xc000075cf0 pc=0x4a5d28
runtime.(*mspan).reportZombies(0x7b8257a312b0)
/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/mgcsweep.go:877 +0x2ea fp=0xc000075da0 sp=0xc000075d20 pc=0x45a48a
runtime.(*sweepLocked).sweep(0x7b2280?, 0x0)
/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/mgcsweep.go:657 +0xcf4 fp=0xc000075ee0 sp=0xc000075da0 pc=0x459cb4
runtime.sweepone()
...
runtime.gopark(0x8c26894275?, 0x43ead4?, 0x5f?, 0x80?, 0xc000188050?)
/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/proc.go:435 +0xce fp=0xc000128ef8 sp=0xc000128ed8 pc=0x4a5e6e
time.Sleep(0x3d0900)
/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/time.go:338 +0x165 fp=0xc000128f50 sp=0xc000128ef8 pc=0x4a9165
weak_test.TestIssue69210.func2()
/home/swarming/.swarming/w/ir/x/w/goroot/src/weak/pointer_test.go:197 +0x13a fp=0xc000128fe0 sp=0xc000128f50 pc=0x5db0da
runtime.goexit({})
/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc000128fe8 sp=0xc000128fe0 pc=0x4acd21
created by weak_test.TestIssue69210 in goroutine 34
/home/swarming/.swarming/w/ir/x/w/goroot/src/weak/pointer_test.go:187 +0x25c
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (18 by maintainers)
Commits related to this issue
- runtime: keep cleanup closure alive across adding the cleanup special This is similar to the weak handle bug in #70455. In short, there's a window where a heap-allocated value is only visible through... — committed to golang/go by mknyszek 2 years ago
- runtime: explicitly keep handle alive during getOrAddWeakHandle getOrAddWeakHandle is very careful about keeping its input alive across the operation, but not very careful about keeping the heap-allo... — committed to rizalgowandy/go by mknyszek 2 years ago
- [release-branch.go1.23] runtime: explicitly keep handle alive during getOrAddWeakHandle getOrAddWeakHandle is very careful about keeping its input alive across the operation, but not very careful abo... — committed to golang/go by mknyszek 2 years ago
- [release-branch.go1.23] runtime: explicitly keep handle alive during getOrAddWeakHandle getOrAddWeakHandle is very careful about keeping its input alive across the operation, but not very careful abo... — committed to tailscale/go by mknyszek 2 years ago
It took a couple minutes of execution under
stress2, but I did successfully reproduce it locally with-race.I do think it’s interesting that this has only happened in race mode. I wonder if the race instrumentation is breaking any of the assumptions the weak->strong conversion code makes.
More likely though is that it’s a more general bug but race mode is just good at reproducing the timing. We only have two data points after all.
There’s also #70048, which at first glance seems to be reporting a data race from when it was internal/weak, but maybe that is something else or maybe already resolved?
Oh that’s fun. Thanks for the CC!