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

runtime/coverage: out-of-bounds panic in VisitFuncs via processCoverTestDir #64119

Open
gopherbot opened this issue Nov 14, 2023 · 5 comments
Open
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@gopherbot
Copy link

gopherbot commented Nov 14, 2023

#!watchflakes
post <- log ~ `panic: runtime error: slice bounds out of range` && log ~ `^\s*runtime/coverage\.\(\*emitState\)\.VisitFuncs`

Issue created automatically to collect these failures.

Example (log):

vcs-test.golang.org rerouted to http://127.0.0.1:43053
https://vcs-test.golang.org rerouted to https://127.0.0.1:44521
go test proxy running at GOPROXY=http://127.0.0.1:40533/mod
2023/11/14 16:00:23 http: TLS handshake error from 127.0.0.1:50386: read tcp 127.0.0.1:44521->127.0.0.1:50386: read: connection reset by peer
2023/11/14 16:00:39 http: TLS handshake error from 127.0.0.1:50772: read tcp 127.0.0.1:44521->127.0.0.1:50772: read: connection reset by peer
2023/11/14 16:00:39 http: TLS handshake error from 127.0.0.1:50792: read tcp 127.0.0.1:44521->127.0.0.1:50792: read: connection reset by peer
2023/11/14 16:00:39 http: TLS handshake error from 127.0.0.1:50780: EOF
2023/11/14 16:00:44 http: TLS handshake error from 127.0.0.1:50906: EOF
2023/11/14 16:00:44 http: TLS handshake error from 127.0.0.1:50916: EOF
2023/11/14 16:00:44 http: TLS handshake error from 127.0.0.1:50922: EOF
...
--- FAIL: TestScript (0.06s)
    --- FAIL: TestScript/cover_pkgall_runtime (6.05s)
        script_test.go:132: 2023-11-14T16:01:03Z
        script_test.go:134: $WORK=/workdir/tmp/cmd-go-test-1942127129/tmpdir4285299461/cover_pkgall_runtime1388929147
        script_test.go:156: 
            > env GO111MODULE=off
            # Issue 23882 (6.045s)
            > [short] skip
            [condition not met]
            > go test -coverpkg=all x
...
            testing.(*M).Run.deferwrap1()
            	/workdir/go/src/testing/testing.go:2004 +0x27 fp=0xa104df8 sp=0xa104df0 pc=0x820cd67
            testing.(*M).Run(0xa05e0a0)
            	/workdir/go/src/testing/testing.go:2055 +0x12fb fp=0xa104f68 sp=0xa104df8 pc=0x820c99b
            main.main()
            	_testmain.go:81 +0x195 fp=0xa104fac sp=0xa104f68 pc=0x822e025
            runtime.main()
            	/workdir/go/src/runtime/proc.go:271 +0x4e7 fp=0xa104ff0 sp=0xa104fac pc=0x80b9c07
            runtime.goexit({})
            	/workdir/go/src/runtime/asm_386.s:1363 +0x1 fp=0xa104ff4 sp=0xa104ff0 pc=0x81141d1

watchflakes

@gopherbot gopherbot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 14, 2023
@gopherbot
Copy link
Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "cmd/go" && test == "TestScript"
2023-11-14 15:24 linux-386-longtest go@31f0af1e cmd/go.TestScript (log)
vcs-test.golang.org rerouted to http://127.0.0.1:43053
https://vcs-test.golang.org rerouted to https://127.0.0.1:44521
go test proxy running at GOPROXY=http://127.0.0.1:40533/mod
2023/11/14 16:00:23 http: TLS handshake error from 127.0.0.1:50386: read tcp 127.0.0.1:44521->127.0.0.1:50386: read: connection reset by peer
2023/11/14 16:00:39 http: TLS handshake error from 127.0.0.1:50772: read tcp 127.0.0.1:44521->127.0.0.1:50772: read: connection reset by peer
2023/11/14 16:00:39 http: TLS handshake error from 127.0.0.1:50792: read tcp 127.0.0.1:44521->127.0.0.1:50792: read: connection reset by peer
2023/11/14 16:00:39 http: TLS handshake error from 127.0.0.1:50780: EOF
2023/11/14 16:00:44 http: TLS handshake error from 127.0.0.1:50906: EOF
2023/11/14 16:00:44 http: TLS handshake error from 127.0.0.1:50916: EOF
2023/11/14 16:00:44 http: TLS handshake error from 127.0.0.1:50922: EOF
...
--- FAIL: TestScript (0.06s)
    --- FAIL: TestScript/cover_pkgall_runtime (6.05s)
        script_test.go:132: 2023-11-14T16:01:03Z
        script_test.go:134: $WORK=/workdir/tmp/cmd-go-test-1942127129/tmpdir4285299461/cover_pkgall_runtime1388929147
        script_test.go:156: 
            > env GO111MODULE=off
            # Issue 23882 (6.045s)
            > [short] skip
            [condition not met]
            > go test -coverpkg=all x
...
            testing.(*M).Run.deferwrap1()
            	/workdir/go/src/testing/testing.go:2004 +0x27 fp=0xa104df8 sp=0xa104df0 pc=0x820cd67
            testing.(*M).Run(0xa05e0a0)
            	/workdir/go/src/testing/testing.go:2055 +0x12fb fp=0xa104f68 sp=0xa104df8 pc=0x820c99b
            main.main()
            	_testmain.go:81 +0x195 fp=0xa104fac sp=0xa104f68 pc=0x822e025
            runtime.main()
            	/workdir/go/src/runtime/proc.go:271 +0x4e7 fp=0xa104ff0 sp=0xa104fac pc=0x80b9c07
            runtime.goexit({})
            	/workdir/go/src/runtime/asm_386.s:1363 +0x1 fp=0xa104ff4 sp=0xa104ff0 pc=0x81141d1

watchflakes

@bcmills bcmills added the compiler/runtime Issues related to the Go compiler and/or runtime. label Nov 14, 2023
@bcmills bcmills changed the title cmd/go: TestScript failures runtime/coverage: out-of-bounds panic in VisitFuncs Nov 14, 2023
@bcmills bcmills changed the title runtime/coverage: out-of-bounds panic in VisitFuncs runtime/coverage: out-of-bounds panic in VisitFuncs via processCoverTestDir Nov 14, 2023
@bcmills
Copy link
Contributor

bcmills commented Nov 14, 2023

(attn @thanm)

@bcmills bcmills added this to the Go1.22 milestone Nov 14, 2023
@gopherbot

This comment was marked as resolved.

@gopherbot
Copy link
Author

Found new dashboard test flakes for:

#!watchflakes
post <- log ~ `panic: runtime error: slice bounds out of range` && log ~ `^\s*runtime/coverage\.\(\*emitState\)\.VisitFuncs`
2024-04-19 18:02 gotip-linux-amd64-longtest go@903e0ffb runtime/coverage.TestCoverageApis/emitToDir (log)
=== RUN   TestCoverageApis/emitToDir
=== PAUSE TestCoverageApis/emitToDir
=== CONT  TestCoverageApis/emitToDir
    emitdata_test.go:166: running: /home/swarming/.swarming/w/ir/x/t/TestCoverageApis2382941171/001/build1/harness.exe -tp emitToDir -o /home/swarming/.swarming/w/ir/x/t/TestCoverageApis2382941171/001/emitToDir-edir-y with rdir=/home/swarming/.swarming/w/ir/x/t/TestCoverageApis2382941171/001/emitToDir-rdir-y and GOCOVERDIR=false
    emitdata_test.go:232: warning: GOCOVERDIR not set, no coverage data emitted
        panic: runtime error: slice bounds out of range [:4294986543] with capacity 26714
        
        goroutine 1 gp=0xc0000061c0 m=0 mp=0x6ec060 [running]:
        panic({0x59b8c0?, 0xc00001c168?})
        	/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/panic.go:778 +0x2c5 fp=0xc000076aa0 sp=0xc0000769f0 pc=0x479f85
...
        runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        	/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/proc.go:401 +0x24a fp=0xc000063e20 sp=0xc000063e00 pc=0x4814aa
        runtime.runfinq()
        	/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/mfinal.go:193 +0x3f1 fp=0xc000063fe0 sp=0xc000063e20 pc=0x436b31
        runtime.goexit({})
        	/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc000063fe8 sp=0xc000063fe0 pc=0x4f2b61
        created by runtime.createfing in goroutine 1
        	/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/mfinal.go:163 +0x86
    emitdata_test.go:233: running 'harness -tp emitDir': exit status 2
--- FAIL: TestCoverageApis/emitToDir (0.06s)

watchflakes

@gopherbot
Copy link
Author

Found new dashboard test flakes for:

#!watchflakes
post <- log ~ `panic: runtime error: slice bounds out of range` && log ~ `^\s*runtime/coverage\.\(\*emitState\)\.VisitFuncs`
2024-04-26 21:32 gotip-linux-amd64-longtest-race go@b439f328 cmd/go.TestScript/cover_pkgall_imports (log)
=== RUN   TestScript/cover_pkgall_imports
=== PAUSE TestScript/cover_pkgall_imports
=== CONT  TestScript/cover_pkgall_imports
    script_test.go:136: 2024-04-26T21:46:05Z
    script_test.go:138: $WORK=/home/swarming/.swarming/w/ir/x/t/cmd-go-test-3389379500/tmpdir349860348/cover_pkgall_imports565685813
    script_test.go:160: 
        PATH=/home/swarming/.swarming/w/ir/x/t/cmd-go-test-3389379500/tmpdir349860348/testbin:/home/swarming/.swarming/w/ir/x/w/goroot/bin:/home/swarming/.swarming/w/ir/x/w/goroot/bin:/home/swarming/.swarming/w/ir/x/w/goroot/bin:/home/swarming/.swarming/w/ir/cache/tools/bin:/home/swarming/.swarming/w/ir/bbagent_utility_packages:/home/swarming/.swarming/w/ir/bbagent_utility_packages/bin:/home/swarming/.swarming/w/ir/cipd_bin_packages:/home/swarming/.swarming/w/ir/cipd_bin_packages/bin:/home/swarming/.swarming/w/ir/cipd_bin_packages/cpython3:/home/swarming/.swarming/w/ir/cipd_bin_packages/cpython3/bin:/home/swarming/.swarming/w/ir/cache/cipd_client:/home/swarming/.swarming/w/ir/cache/cipd_client/bin:/home/swarming/.swarming/cipd_cache/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
        HOME=/no-home
        CCACHE_DISABLE=1
        GOARCH=amd64
...
        panic: runtime error: slice bounds out of range [:4294970640] with capacity 33320
        
        goroutine 1 gp=0xc0000081c0 m=0 mp=0x7e7480 [running]:
        panic({0x626b20?, 0xc00014c030?})
        	/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/panic.go:778 +0x2a5 fp=0xc0000e52a0 sp=0xc0000e51f0 pc=0x464ea5
        runtime.goPanicSliceAcap(0x100000d10, 0x8228)
        	/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/panic.go:140 +0x97 fp=0xc0000e52e0 sp=0xc0000e52a0 pc=0x463417
        runtime/coverage.(*emitState).VisitFuncs(0xc000128000, 0xc000150000)
        	/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/coverage/emit.go:483 +0x79a fp=0xc0000e5408 sp=0xc0000e52e0 pc=0x5b551a
        internal/coverage/encodecounter.(*CoverageDataWriter).writeCounters(0xc00011e050, {0x67bda0, 0xc000128000}, 0xc00011a040)
...
        	/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/mfinal.go:193 +0x27e fp=0xc0000667e0 sp=0xc000066620 pc=0x42c6be
        runtime.goexit({})
        	/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/asm_amd64.s:1699 +0x1 fp=0xc0000667e8 sp=0xc0000667e0 pc=0x4c9a81
        created by runtime.createfing in goroutine 1
        	/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/mfinal.go:163 +0xab
        FAIL	example.com/cov/onlytest	0.012s
        ok  	example.com/cov/withtest	0.091s	coverage: 15.7% of statements in all
        FAIL
    script_test.go:160: FAIL: testdata/script/cover_pkgall_imports.txt:10: go test -coverpkg=all ./...: exit status 1
--- FAIL: TestScript/cover_pkgall_imports (28.13s)

watchflakes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Status: No status
Development

No branches or pull requests

3 participants