Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing: integer divide by zero in predictN #70709

Closed
dmitshur opened this issue Dec 6, 2024 · 5 comments
Closed

testing: integer divide by zero in predictN #70709

dmitshur opened this issue Dec 6, 2024 · 5 comments
Labels
NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@dmitshur
Copy link
Contributor

dmitshur commented Dec 6, 2024

Go version

go version devel go1.24-3ae00f5d29 Fri Dec 6 02:16:12 2024 +0000 darwin/arm64

Output of go env in your module/workspace:

$ go env -changed
GOFLAGS='-ldflags=-extldflags=-Wl,-no_warn_duplicate_libraries'  # workaround for go.dev/issue/67799

$ go env
AR='ar'
CC='clang'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='clang++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/Users/gopher/Library/Caches/go-build'
GODEBUG=''
GOENV='/Users/gopher/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS='-ldflags=-extldflags=-Wl,-no_warn_duplicate_libraries'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/yn/rz8r25f10z5fmwdg34tz6z1c0000gn/T/go-build955700323=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/dev/null'
GOMODCACHE='/Users/gopher/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/gopher/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/gopher/gotip'
GOSUMDB='sum.golang.org'
GOTELEMETRY='on'
GOTELEMETRYDIR='/Users/gopher/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/gopher/gotip/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='devel go1.24-3ae00f5d29 Fri Dec 6 02:16:12 2024 +0000'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

Ran all.bash at Go tip (commit 3ae00f5).

What did you see happen?

panic: runtime error: integer divide by zero

goroutine 574 gp=0x140001adc00 m=4 mp=0x14000088008 [running]:
panic({0x100db05c0?, 0x100f260a0?})
	/Users/gopher/gotip/src/runtime/panic.go:806 +0x154 fp=0x14000105ea0 sp=0x14000105df0 pc=0x100c06c04
runtime.panicdivide()
	/Users/gopher/gotip/src/runtime/panic.go:241 +0x48 fp=0x14000105ec0 sp=0x14000105ea0 pc=0x100bcdc58
testing.predictN(...)
	/Users/gopher/gotip/src/testing/benchmark.go:283
testing.(*B).stopOrScaleBLoop(0x14000276008)
	/Users/gopher/gotip/src/testing/benchmark.go:375 +0xdc fp=0x14000105ef0 sp=0x14000105ec0 pc=0x100c9a4ac
testing.(*B).loopSlowPath(0x140000a5f38?)
	/Users/gopher/gotip/src/testing/benchmark.go:400 +0x6c fp=0x14000105f10 sp=0x14000105ef0 pc=0x100c9a53c
testing.(*B).Loop(...)
	/Users/gopher/gotip/src/testing/benchmark.go:429
testing_test.TestBLoopHasResults.func1(0x14000276008)
	/Users/gopher/gotip/src/testing/benchmark_test.go:135 +0x58 fp=0x14000105f40 sp=0x14000105f10 pc=0x100d27a08
testing.(*B).runN(0x14000276008, 0x1)
	/Users/gopher/gotip/src/testing/benchmark.go:199 +0x130 fp=0x14000105f90 sp=0x14000105f40 pc=0x100c997a0
testing.(*B).run1.func1()
	/Users/gopher/gotip/src/testing/benchmark.go:221 +0x4c fp=0x14000105fd0 sp=0x14000105f90 pc=0x100c99dbc
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x14000105fd0 sp=0x14000105fd0 pc=0x100c0e844
created by testing.(*B).run1 in goroutine 573
	/Users/gopher/gotip/src/testing/benchmark.go:214 +0x90

[...]

FAIL	testing	0.612s

benchmark.go:283 is https://cs.opensource.google/go/go/+/master:src/testing/benchmark.go;l=283;drc=5213e1e56c17bde612398dac8a2996bf020fe542.


panic: runtime error: integer divide by zero

goroutine 574 gp=0x140001adc00 m=4 mp=0x14000088008 [running]:
panic({0x100db05c0?, 0x100f260a0?})
	/Users/gopher/gotip/src/runtime/panic.go:806 +0x154 fp=0x14000105ea0 sp=0x14000105df0 pc=0x100c06c04
runtime.panicdivide()
	/Users/gopher/gotip/src/runtime/panic.go:241 +0x48 fp=0x14000105ec0 sp=0x14000105ea0 pc=0x100bcdc58
testing.predictN(...)
	/Users/gopher/gotip/src/testing/benchmark.go:283
testing.(*B).stopOrScaleBLoop(0x14000276008)
	/Users/gopher/gotip/src/testing/benchmark.go:375 +0xdc fp=0x14000105ef0 sp=0x14000105ec0 pc=0x100c9a4ac
testing.(*B).loopSlowPath(0x140000a5f38?)
	/Users/gopher/gotip/src/testing/benchmark.go:400 +0x6c fp=0x14000105f10 sp=0x14000105ef0 pc=0x100c9a53c
testing.(*B).Loop(...)
	/Users/gopher/gotip/src/testing/benchmark.go:429
testing_test.TestBLoopHasResults.func1(0x14000276008)
	/Users/gopher/gotip/src/testing/benchmark_test.go:135 +0x58 fp=0x14000105f40 sp=0x14000105f10 pc=0x100d27a08
testing.(*B).runN(0x14000276008, 0x1)
	/Users/gopher/gotip/src/testing/benchmark.go:199 +0x130 fp=0x14000105f90 sp=0x14000105f40 pc=0x100c997a0
testing.(*B).run1.func1()
	/Users/gopher/gotip/src/testing/benchmark.go:221 +0x4c fp=0x14000105fd0 sp=0x14000105f90 pc=0x100c99dbc
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x14000105fd0 sp=0x14000105fd0 pc=0x100c0e844
created by testing.(*B).run1 in goroutine 573
	/Users/gopher/gotip/src/testing/benchmark.go:214 +0x90

goroutine 1 gp=0x140000021c0 m=nil [chan receive]:
runtime.gopark(0x1400018c018?, 0x14000106978?, 0x9e?, 0xf8?, 0x107ab6948?)
	/Users/gopher/gotip/src/runtime/proc.go:435 +0xc8 fp=0x14000106930 sp=0x14000106910 pc=0x100c06fe8
runtime.chanrecv(0x140000ba070, 0x14000106a37, 0x1)
	/Users/gopher/gotip/src/runtime/chan.go:664 +0x42c fp=0x140001069b0 sp=0x14000106930 pc=0x100ba190c
runtime.chanrecv1(0x100f312e0?, 0x100df0440?)
	/Users/gopher/gotip/src/runtime/chan.go:506 +0x14 fp=0x140001069e0 sp=0x140001069b0 pc=0x100ba14a4
testing.(*T).Run(0x14000003500, {0x100d3ff3b?, 0x14000106af8?}, 0x100de8b60)
	/Users/gopher/gotip/src/testing/testing.go:1831 +0x388 fp=0x14000106ac0 sp=0x140001069e0 pc=0x100ca8bd8
testing.runTests.func1(0x14000003500)
	/Users/gopher/gotip/src/testing/testing.go:2251 +0x40 fp=0x14000106b00 sp=0x14000106ac0 pc=0x100caab60
testing.tRunner(0x14000003500, 0x14000106c28)
	/Users/gopher/gotip/src/testing/testing.go:1764 +0xe4 fp=0x14000106b50 sp=0x14000106b00 pc=0x100ca7e74
testing.runTests(0x1400000c018, {0x100f2df00, 0x44, 0x44}, {0xaa138f239b5ab4a4?, 0x0?, 0x100f314c0?})
	/Users/gopher/gotip/src/testing/testing.go:2249 +0x3ec fp=0x14000106c50 sp=0x14000106b50 pc=0x100caaa7c
testing.(*M).Run(0x1400010a140)
	/Users/gopher/gotip/src/testing/testing.go:2114 +0x588 fp=0x14000106e80 sp=0x14000106c50 pc=0x100ca97d8
testing_test.TestMain(0x1400010a140)
	/Users/gopher/gotip/src/testing/testing_test.go:35 +0x4c fp=0x14000106ea0 sp=0x14000106e80 pc=0x100d2a46c
main.main()
	_testmain.go:197 +0x98 fp=0x14000106f40 sp=0x14000106ea0 pc=0x100d31088
runtime.main()
	/Users/gopher/gotip/src/runtime/proc.go:283 +0x284 fp=0x14000106fd0 sp=0x14000106f40 pc=0x100bd2464
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x14000106fd0 sp=0x14000106fd0 pc=0x100c0e844

goroutine 2 gp=0x14000002700 m=nil [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/Users/gopher/gotip/src/runtime/proc.go:435 +0xc8 fp=0x14000060f90 sp=0x14000060f70 pc=0x100c06fe8
runtime.goparkunlock(...)
	/Users/gopher/gotip/src/runtime/proc.go:441
runtime.forcegchelper()
	/Users/gopher/gotip/src/runtime/proc.go:348 +0xb8 fp=0x14000060fd0 sp=0x14000060f90 pc=0x100bd27b8
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x14000060fd0 sp=0x14000060fd0 pc=0x100c0e844
created by runtime.init.7 in goroutine 1
	/Users/gopher/gotip/src/runtime/proc.go:336 +0x24

goroutine 3 gp=0x14000002c40 m=nil [GC sweep wait]:
runtime.gopark(0x100f31101?, 0x0?, 0x0?, 0x0?, 0x0?)
	/Users/gopher/gotip/src/runtime/proc.go:435 +0xc8 fp=0x14000061760 sp=0x14000061740 pc=0x100c06fe8
runtime.goparkunlock(...)
	/Users/gopher/gotip/src/runtime/proc.go:441
runtime.bgsweep(0x14000078000)
	/Users/gopher/gotip/src/runtime/mgcsweep.go:316 +0x108 fp=0x140000617b0 sp=0x14000061760 pc=0x100bbbee8
runtime.gcenable.gowrap1()
	/Users/gopher/gotip/src/runtime/mgc.go:204 +0x28 fp=0x140000617d0 sp=0x140000617b0 pc=0x100bafd78
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x140000617d0 sp=0x140000617d0 pc=0x100c0e844
created by runtime.gcenable in goroutine 1
	/Users/gopher/gotip/src/runtime/mgc.go:204 +0x6c

goroutine 4 gp=0x14000002e00 m=nil [runnable]:
runtime.gopark(0x10000?, 0x6553f100?, 0x0?, 0x0?, 0x0?)
	/Users/gopher/gotip/src/runtime/proc.go:435 +0xc8 fp=0x14000061f60 sp=0x14000061f40 pc=0x100c06fe8
runtime.goparkunlock(...)
	/Users/gopher/gotip/src/runtime/proc.go:441
runtime.(*scavengerState).park(0x100f31540)
	/Users/gopher/gotip/src/runtime/mgcscavenge.go:425 +0x5c fp=0x14000061f90 sp=0x14000061f60 pc=0x100bb998c
runtime.bgscavenge(0x14000078000)
	/Users/gopher/gotip/src/runtime/mgcscavenge.go:658 +0xac fp=0x14000061fb0 sp=0x14000061f90 pc=0x100bb9f2c
runtime.gcenable.gowrap2()
	/Users/gopher/gotip/src/runtime/mgc.go:205 +0x28 fp=0x14000061fd0 sp=0x14000061fb0 pc=0x100bafd18
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x14000061fd0 sp=0x14000061fd0 pc=0x100c0e844
created by runtime.gcenable in goroutine 1
	/Users/gopher/gotip/src/runtime/mgc.go:205 +0xac

goroutine 5 gp=0x14000003340 m=nil [finalizer wait]:
runtime.gopark(0x140000605b8?, 0x100c07c74?, 0x1?, 0x5?, 0x100c38544?)
	/Users/gopher/gotip/src/runtime/proc.go:435 +0xc8 fp=0x14000060590 sp=0x14000060570 pc=0x100c06fe8
runtime.runfinq()
	/Users/gopher/gotip/src/runtime/mfinal.go:196 +0x108 fp=0x140000607d0 sp=0x14000060590 pc=0x100baed78
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x140000607d0 sp=0x140000607d0 pc=0x100c0e844
created by runtime.createfing in goroutine 1
	/Users/gopher/gotip/src/runtime/mfinal.go:166 +0x80

goroutine 573 gp=0x14000003880 m=nil [runnable]:
runtime.gopark(0x1000583be?, 0x100ca7dc3?, 0xb8?, 0x8c?, 0x107a87978?)
	/Users/gopher/gotip/src/runtime/proc.go:435 +0xc8 fp=0x14000108c70 sp=0x14000108c50 pc=0x100c06fe8
runtime.chanrecv(0x140000ba0e0, 0x0, 0x1)
	/Users/gopher/gotip/src/runtime/chan.go:664 +0x42c fp=0x14000108cf0 sp=0x14000108c70 pc=0x100ba190c
runtime.chanrecv1(0x100eebd88?, 0x0?)
	/Users/gopher/gotip/src/runtime/chan.go:506 +0x14 fp=0x14000108d20 sp=0x14000108cf0 pc=0x100ba14a4
testing.(*B).run1(0x14000276008)
	/Users/gopher/gotip/src/testing/benchmark.go:223 +0xa0 fp=0x14000108e20 sp=0x14000108d20 pc=0x100c999a0
testing.Benchmark(0x14000194060)
	/Users/gopher/gotip/src/testing/benchmark.go:912 +0xc0 fp=0x14000108e90 sp=0x14000108e20 pc=0x100c9c940
testing_test.TestBLoopHasResults(0x140000bc000)
	/Users/gopher/gotip/src/testing/benchmark_test.go:133 +0x70 fp=0x14000108f60 sp=0x14000108e90 pc=0x100d27890
testing.tRunner(0x140000bc000, 0x100de8b60)
	/Users/gopher/gotip/src/testing/testing.go:1764 +0xe4 fp=0x14000108fb0 sp=0x14000108f60 pc=0x100ca7e74
testing.(*T).Run.gowrap1()
	/Users/gopher/gotip/src/testing/testing.go:1823 +0x2c fp=0x14000108fd0 sp=0x14000108fb0 pc=0x100ca8cfc
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x14000108fd0 sp=0x14000108fd0 pc=0x100c0e844
created by testing.(*T).Run in goroutine 1
	/Users/gopher/gotip/src/testing/testing.go:1823 +0x374

goroutine 87 gp=0x140001a9c00 m=nil [chan receive]:
runtime.gopark(0x14000109e48?, 0x100ba0608?, 0x78?, 0x9e?, 0x1400007c300?)
	/Users/gopher/gotip/src/runtime/proc.go:435 +0xc8 fp=0x14000109dd0 sp=0x14000109db0 pc=0x100c06fe8
runtime.chanrecv(0x1400022f110, 0x0, 0x1)
	/Users/gopher/gotip/src/runtime/chan.go:664 +0x42c fp=0x14000109e50 sp=0x14000109dd0 pc=0x100ba190c
runtime.chanrecv1(0x100f312e0?, 0x100df0440?)
	/Users/gopher/gotip/src/runtime/chan.go:506 +0x14 fp=0x14000109e80 sp=0x14000109e50 pc=0x100ba14a4
testing.(*T).Parallel(0x14000231880)
	/Users/gopher/gotip/src/testing/testing.go:1549 +0x1b0 fp=0x14000109f20 sp=0x14000109e80 pc=0x100ca7af0
testing.TestTRun.func11(0x14000231880)
	/Users/gopher/gotip/src/testing/sub_test.go:319 +0x20 fp=0x14000109f60 sp=0x14000109f20 pc=0x100cb3ce0
testing.tRunner(0x14000231880, 0x100de8e20)
	/Users/gopher/gotip/src/testing/testing.go:1764 +0xe4 fp=0x14000109fb0 sp=0x14000109f60 pc=0x100ca7e74
testing.(*T).Run.gowrap1()
	/Users/gopher/gotip/src/testing/testing.go:1823 +0x2c fp=0x14000109fd0 sp=0x14000109fb0 pc=0x100ca8cfc
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x14000109fd0 sp=0x14000109fd0 pc=0x100c0e844
created by testing.(*T).Run in goroutine 86
	/Users/gopher/gotip/src/testing/testing.go:1823 +0x374

goroutine 122 gp=0x140001ac000 m=nil [GC worker (idle)]:
runtime.gopark(0x1400005ff58?, 0x100ca7dc4?, 0xc4?, 0x7d?, 0x1400005ff50?)
	/Users/gopher/gotip/src/runtime/proc.go:435 +0xc8 fp=0x1400005ff10 sp=0x1400005fef0 pc=0x100c06fe8
runtime.gcBgMarkWorker(0x1400024bc00)
	/Users/gopher/gotip/src/runtime/mgc.go:1423 +0xdc fp=0x1400005ffb0 sp=0x1400005ff10 pc=0x100bb220c
runtime.gcBgMarkStartWorkers.gowrap1()
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x28 fp=0x1400005ffd0 sp=0x1400005ffb0 pc=0x100bb20f8
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x1400005ffd0 sp=0x1400005ffd0 pc=0x100c0e844
created by runtime.gcBgMarkStartWorkers in goroutine 120
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x140

goroutine 123 gp=0x140001ac380 m=nil [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/Users/gopher/gotip/src/runtime/proc.go:435 +0xc8 fp=0x1400027c710 sp=0x1400027c6f0 pc=0x100c06fe8
runtime.gcBgMarkWorker(0x1400024bc00)
	/Users/gopher/gotip/src/runtime/mgc.go:1423 +0xdc fp=0x1400027c7b0 sp=0x1400027c710 pc=0x100bb220c
runtime.gcBgMarkStartWorkers.gowrap1()
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x28 fp=0x1400027c7d0 sp=0x1400027c7b0 pc=0x100bb20f8
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x1400027c7d0 sp=0x1400027c7d0 pc=0x100c0e844
created by runtime.gcBgMarkStartWorkers in goroutine 120
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x140

goroutine 121 gp=0x140001ac700 m=nil [GC worker (idle)]:
runtime.gopark(0x1400005f758?, 0x100ca7dc4?, 0xc4?, 0x7d?, 0x1400005f750?)
	/Users/gopher/gotip/src/runtime/proc.go:435 +0xc8 fp=0x1400005f710 sp=0x1400005f6f0 pc=0x100c06fe8
runtime.gcBgMarkWorker(0x1400024bc00)
	/Users/gopher/gotip/src/runtime/mgc.go:1423 +0xdc fp=0x1400005f7b0 sp=0x1400005f710 pc=0x100bb220c
runtime.gcBgMarkStartWorkers.gowrap1()
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x28 fp=0x1400005f7d0 sp=0x1400005f7b0 pc=0x100bb20f8
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x1400005f7d0 sp=0x1400005f7d0 pc=0x100c0e844
created by runtime.gcBgMarkStartWorkers in goroutine 120
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x140

goroutine 124 gp=0x14000224380 m=nil [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/Users/gopher/gotip/src/runtime/proc.go:435 +0xc8 fp=0x1400027cf10 sp=0x1400027cef0 pc=0x100c06fe8
runtime.gcBgMarkWorker(0x1400024bc00)
	/Users/gopher/gotip/src/runtime/mgc.go:1423 +0xdc fp=0x1400027cfb0 sp=0x1400027cf10 pc=0x100bb220c
runtime.gcBgMarkStartWorkers.gowrap1()
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x28 fp=0x1400027cfd0 sp=0x1400027cfb0 pc=0x100bb20f8
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x1400027cfd0 sp=0x1400027cfd0 pc=0x100c0e844
created by runtime.gcBgMarkStartWorkers in goroutine 120
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x140

goroutine 125 gp=0x14000230540 m=nil [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/Users/gopher/gotip/src/runtime/proc.go:435 +0xc8 fp=0x1400027d710 sp=0x1400027d6f0 pc=0x100c06fe8
runtime.gcBgMarkWorker(0x1400024bc00)
	/Users/gopher/gotip/src/runtime/mgc.go:1423 +0xdc fp=0x1400027d7b0 sp=0x1400027d710 pc=0x100bb220c
runtime.gcBgMarkStartWorkers.gowrap1()
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x28 fp=0x1400027d7d0 sp=0x1400027d7b0 pc=0x100bb20f8
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x1400027d7d0 sp=0x1400027d7d0 pc=0x100c0e844
created by runtime.gcBgMarkStartWorkers in goroutine 120
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x140

goroutine 126 gp=0x140002308c0 m=nil [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/Users/gopher/gotip/src/runtime/proc.go:435 +0xc8 fp=0x1400027df10 sp=0x1400027def0 pc=0x100c06fe8
runtime.gcBgMarkWorker(0x1400024bc00)
	/Users/gopher/gotip/src/runtime/mgc.go:1423 +0xdc fp=0x1400027dfb0 sp=0x1400027df10 pc=0x100bb220c
runtime.gcBgMarkStartWorkers.gowrap1()
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x28 fp=0x1400027dfd0 sp=0x1400027dfb0 pc=0x100bb20f8
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x1400027dfd0 sp=0x1400027dfd0 pc=0x100c0e844
created by runtime.gcBgMarkStartWorkers in goroutine 120
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x140

goroutine 127 gp=0x14000280000 m=nil [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/Users/gopher/gotip/src/runtime/proc.go:435 +0xc8 fp=0x1400027e710 sp=0x1400027e6f0 pc=0x100c06fe8
runtime.gcBgMarkWorker(0x1400024bc00)
	/Users/gopher/gotip/src/runtime/mgc.go:1423 +0xdc fp=0x1400027e7b0 sp=0x1400027e710 pc=0x100bb220c
runtime.gcBgMarkStartWorkers.gowrap1()
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x28 fp=0x1400027e7d0 sp=0x1400027e7b0 pc=0x100bb20f8
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x1400027e7d0 sp=0x1400027e7d0 pc=0x100c0e844
created by runtime.gcBgMarkStartWorkers in goroutine 120
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x140

goroutine 128 gp=0x140002801c0 m=nil [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/Users/gopher/gotip/src/runtime/proc.go:435 +0xc8 fp=0x1400027ef10 sp=0x1400027eef0 pc=0x100c06fe8
runtime.gcBgMarkWorker(0x1400024bc00)
	/Users/gopher/gotip/src/runtime/mgc.go:1423 +0xdc fp=0x1400027efb0 sp=0x1400027ef10 pc=0x100bb220c
runtime.gcBgMarkStartWorkers.gowrap1()
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x28 fp=0x1400027efd0 sp=0x1400027efb0 pc=0x100bb20f8
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x1400027efd0 sp=0x1400027efd0 pc=0x100c0e844
created by runtime.gcBgMarkStartWorkers in goroutine 120
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x140

goroutine 129 gp=0x14000280380 m=nil [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/Users/gopher/gotip/src/runtime/proc.go:435 +0xc8 fp=0x1400027f710 sp=0x1400027f6f0 pc=0x100c06fe8
runtime.gcBgMarkWorker(0x1400024bc00)
	/Users/gopher/gotip/src/runtime/mgc.go:1423 +0xdc fp=0x1400027f7b0 sp=0x1400027f710 pc=0x100bb220c
runtime.gcBgMarkStartWorkers.gowrap1()
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x28 fp=0x1400027f7d0 sp=0x1400027f7b0 pc=0x100bb20f8
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x1400027f7d0 sp=0x1400027f7d0 pc=0x100c0e844
created by runtime.gcBgMarkStartWorkers in goroutine 120
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x140

goroutine 130 gp=0x14000280540 m=nil [GC worker (idle)]:
runtime.gopark(0x16fd2067eb11d?, 0x1?, 0xb4?, 0xdc?, 0x0?)
	/Users/gopher/gotip/src/runtime/proc.go:435 +0xc8 fp=0x1400022af10 sp=0x1400022aef0 pc=0x100c06fe8
runtime.gcBgMarkWorker(0x1400024bc00)
	/Users/gopher/gotip/src/runtime/mgc.go:1423 +0xdc fp=0x1400022afb0 sp=0x1400022af10 pc=0x100bb220c
runtime.gcBgMarkStartWorkers.gowrap1()
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x28 fp=0x1400022afd0 sp=0x1400022afb0 pc=0x100bb20f8
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x1400022afd0 sp=0x1400022afd0 pc=0x100c0e844
created by runtime.gcBgMarkStartWorkers in goroutine 120
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x140

goroutine 131 gp=0x14000280700 m=nil [GC worker (idle)]:
runtime.gopark(0x100f58500?, 0x1?, 0x64?, 0x19?, 0x0?)
	/Users/gopher/gotip/src/runtime/proc.go:435 +0xc8 fp=0x14000228f10 sp=0x14000228ef0 pc=0x100c06fe8
runtime.gcBgMarkWorker(0x1400024bc00)
	/Users/gopher/gotip/src/runtime/mgc.go:1423 +0xdc fp=0x14000228fb0 sp=0x14000228f10 pc=0x100bb220c
runtime.gcBgMarkStartWorkers.gowrap1()
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x28 fp=0x14000228fd0 sp=0x14000228fb0 pc=0x100bb20f8
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x14000228fd0 sp=0x14000228fd0 pc=0x100c0e844
created by runtime.gcBgMarkStartWorkers in goroutine 120
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x140

goroutine 132 gp=0x140002808c0 m=nil [GC worker (idle)]:
runtime.gopark(0x100f58500?, 0x1?, 0x52?, 0x99?, 0x0?)
	/Users/gopher/gotip/src/runtime/proc.go:435 +0xc8 fp=0x1400022df10 sp=0x1400022def0 pc=0x100c06fe8
runtime.gcBgMarkWorker(0x1400024bc00)
	/Users/gopher/gotip/src/runtime/mgc.go:1423 +0xdc fp=0x1400022dfb0 sp=0x1400022df10 pc=0x100bb220c
runtime.gcBgMarkStartWorkers.gowrap1()
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x28 fp=0x1400022dfd0 sp=0x1400022dfb0 pc=0x100bb20f8
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x1400022dfd0 sp=0x1400022dfd0 pc=0x100c0e844
created by runtime.gcBgMarkStartWorkers in goroutine 120
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x140

goroutine 133 gp=0x14000280a80 m=nil [GC worker (idle)]:
runtime.gopark(0x16fd20684b403?, 0x1?, 0x9?, 0xc1?, 0x0?)
	/Users/gopher/gotip/src/runtime/proc.go:435 +0xc8 fp=0x14000102f10 sp=0x14000102ef0 pc=0x100c06fe8
runtime.gcBgMarkWorker(0x1400024bc00)
	/Users/gopher/gotip/src/runtime/mgc.go:1423 +0xdc fp=0x14000102fb0 sp=0x14000102f10 pc=0x100bb220c
runtime.gcBgMarkStartWorkers.gowrap1()
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x28 fp=0x14000102fd0 sp=0x14000102fb0 pc=0x100bb20f8
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x14000102fd0 sp=0x14000102fd0 pc=0x100c0e844
created by runtime.gcBgMarkStartWorkers in goroutine 120
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x140

goroutine 134 gp=0x14000280c40 m=nil [GC worker (idle)]:
runtime.gopark(0x100de91a8?, 0x14000015d20?, 0x1b?, 0xa?, 0x0?)
	/Users/gopher/gotip/src/runtime/proc.go:435 +0xc8 fp=0x1400022cf10 sp=0x1400022cef0 pc=0x100c06fe8
runtime.gcBgMarkWorker(0x1400024bc00)
	/Users/gopher/gotip/src/runtime/mgc.go:1423 +0xdc fp=0x1400022cfb0 sp=0x1400022cf10 pc=0x100bb220c
runtime.gcBgMarkStartWorkers.gowrap1()
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x28 fp=0x1400022cfd0 sp=0x1400022cfb0 pc=0x100bb20f8
runtime.goexit({})
	/Users/gopher/gotip/src/runtime/asm_arm64.s:1260 +0x4 fp=0x1400022cfd0 sp=0x1400022cfd0 pc=0x100c0e844
created by runtime.gcBgMarkStartWorkers in goroutine 120
	/Users/gopher/gotip/src/runtime/mgc.go:1339 +0x140
FAIL	testing	0.612s

So far it only happened the one time, and doesn't trivially reproduce when running testing package tests on its own:

$ go test -count=10 testing
ok  	testing	17.086s

What did you expect to see?

All tests passing.

CC @JunyangShao, @prattmic.

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 6, 2024
@dmitshur dmitshur added this to the Go1.24 milestone Dec 6, 2024
@dmitshur
Copy link
Contributor Author

dmitshur commented Dec 6, 2024

go test -count=1000 -run=^TestBLoopHasResults$ testing reliably reproduces this on this machine, a MacBook Pro with M4 Pro, macOS 15.1.1 (24B2091).

@Jorropo
Copy link
Member

Jorropo commented Dec 6, 2024

On linux/amd64 I can't reproduce by default.
Here are my clocksources preferences.

> cat /sys/devices/system/clocksource/clocksource0/current_clocksource 
tsc
> cat /sys/devices/system/clocksource/clocksource0/available_clocksource 
tsc hpet acpi_pm

Manually switching the clocksource to the less accurate acpi_pm still did not make it reproduce (is go calling tsc from userland ? I think the vdsos do.).
However if then from this worst clocksource I run a VM and I don't give it access to the tsc hardware, then it reproduce.

Looking through the code some codepaths sanitize the nanoseconds before calling predictN, others don't. I'll send a fix.

@Jorropo Jorropo self-assigned this Dec 6, 2024
@dmitshur
Copy link
Contributor Author

dmitshur commented Dec 6, 2024

Also reproduces on an M1 Pro machine.

Looking through the code some codepaths sanitize the nanoseconds before calling predictN, others don't. I'll send a fix.

I did that locally (in B.stopOrScaleBLoop) and can confirm it stops it from reproducing. Thanks.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/633419 mentions this issue: testing: fix divide by zero when benchmark is faster than OS's clock resolution

@Jorropo Jorropo removed their assignment Dec 6, 2024
@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants