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

cmd/go: Stack overflow on running: go test -race with -coverpkg=all #23694

Closed
drakonka opened this Issue Feb 4, 2018 · 4 comments

Comments

Projects
None yet
4 participants
@drakonka

drakonka commented Feb 4, 2018

What version of Go are you using (go version)?

go version go1.10rc1 linux/amd64

Does this issue reproduce with the latest release?

Yes, as far as I know this is the latest release

What operating system and processor architecture are you using (go env)?

Fedora 26; GOARCH="amd64"

What did you do?

I ran the following command in the root of my project:
go test -race -coverpkg=all -coverprofile allcoverage1.10.out ./...

If possible, provide a recipe for reproducing the error.

Project source can be found here: https://gitlab.com/drakonka/gosnaillife

I am able to repro the issue 100% by cd-ing into the root dir of the project and running the command above, either through standalone terminal or through JetBrains Goland.

What did you expect to see?

I expect all tests in each package of the project to be run.

What did you see instead?

A stack overflow (full output below). Note that removing the -race arg or the -coverpkg arg avoids this issue. The tests encounter some unexpected failures I didn't see in 1.9, but at least they run instead of failing right away with the following output. This error can also be seen in my CI setup using golang:1.10-rc-stretch image: https://gitlab.com/drakonka/gosnaillife/-/jobs/50965296

runtime: goroutine stack exceeds 1000000000-byte limit
fatal error: stack overflow

runtime stack:
runtime.throw(0x8aba11, 0xe)
        /usr/local/go/src/runtime/panic.go:619 +0x81
runtime.newstack()
        /usr/local/go/src/runtime/stack.go:1054 +0x71f
runtime.morestack()
        /usr/local/go/src/runtime/asm_amd64.s:480 +0x89

goroutine 1 [running]:
fmt.(*pp).fmtInteger(0xc420266300, 0x1642bf, 0x6400000001)
        /usr/local/go/src/fmt/print.go:360 +0x307 fp=0xc440f00378 sp=0xc440f00370 pc=0x4c48c7
fmt.(*pp).printArg(0xc420266300, 0x80bae0, 0xc461598948, 0x64)
        /usr/local/go/src/fmt/print.go:649 +0x837 fp=0xc440f003f0 sp=0xc440f00378 pc=0x4c6db7
fmt.(*pp).doPrintf(0xc420266300, 0x8a6ff4, 0x5, 0xc440f00568, 0x1, 0x1)
        /usr/local/go/src/fmt/print.go:1099 +0x3fa fp=0xc440f004d8 sp=0xc440f003f0 pc=0x4ca17a
fmt.Sprintf(0x8a6ff4, 0x5, 0xc440f00568, 0x1, 0x1, 0x20, 0x0)
        /usr/local/go/src/fmt/print.go:203 +0x66 fp=0xc440f00530 sp=0xc440f004d8 pc=0x4c32c6
cmd/go/internal/work.(*Builder).NewObjdir(0xc42027dc20, 0x4b93fb4096e85b60, 0x8)
        /usr/local/go/src/cmd/go/internal/work/action.go:257 +0x94 fp=0xc440f005a8 sp=0xc440f00530 pc=0x5ea0a4
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:335 +0x53 fp=0xc440f00650 sp=0xc440f005a8 pc=0x61efa3
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f006e8, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f006b8 sp=0xc440f00650 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f00718 sp=0xc440f006b8 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f007c0 sp=0xc440f00718 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f00858, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f00828 sp=0xc440f007c0 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f00888 sp=0xc440f00828 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f00930 sp=0xc440f00888 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f009c8, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f00998 sp=0xc440f00930 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f009f8 sp=0xc440f00998 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f00aa0 sp=0xc440f009f8 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f00b38, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f00b08 sp=0xc440f00aa0 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f00b68 sp=0xc440f00b08 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f00c10 sp=0xc440f00b68 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f00ca8, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f00c78 sp=0xc440f00c10 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f00cd8 sp=0xc440f00c78 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f00d80 sp=0xc440f00cd8 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f00e18, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f00de8 sp=0xc440f00d80 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f00e48 sp=0xc440f00de8 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f00ef0 sp=0xc440f00e48 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f00f88, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f00f58 sp=0xc440f00ef0 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f00fb8 sp=0xc440f00f58 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f01060 sp=0xc440f00fb8 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f010f8, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f010c8 sp=0xc440f01060 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f01128 sp=0xc440f010c8 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f011d0 sp=0xc440f01128 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f01268, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f01238 sp=0xc440f011d0 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f01298 sp=0xc440f01238 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f01340 sp=0xc440f01298 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f013d8, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f013a8 sp=0xc440f01340 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f01408 sp=0xc440f013a8 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f014b0 sp=0xc440f01408 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f01548, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f01518 sp=0xc440f014b0 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f01578 sp=0xc440f01518 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f01620 sp=0xc440f01578 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f016b8, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f01688 sp=0xc440f01620 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f016e8 sp=0xc440f01688 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f01790 sp=0xc440f016e8 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f01828, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f017f8 sp=0xc440f01790 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f01858 sp=0xc440f017f8 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f01900 sp=0xc440f01858 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f01998, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f01968 sp=0xc440f01900 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f019c8 sp=0xc440f01968 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f01a70 sp=0xc440f019c8 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f01b08, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f01ad8 sp=0xc440f01a70 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f01b38 sp=0xc440f01ad8 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f01be0 sp=0xc440f01b38 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f01c78, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f01c48 sp=0xc440f01be0 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f01ca8 sp=0xc440f01c48 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f01d50 sp=0xc440f01ca8 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f01de8, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f01db8 sp=0xc440f01d50 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f01e18 sp=0xc440f01db8 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f01ec0 sp=0xc440f01e18 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f01f58, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f01f28 sp=0xc440f01ec0 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f01f88 sp=0xc440f01f28 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f02030 sp=0xc440f01f88 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f020c8, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f02098 sp=0xc440f02030 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f020f8 sp=0xc440f02098 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f021a0 sp=0xc440f020f8 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f02238, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f02208 sp=0xc440f021a0 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f02268 sp=0xc440f02208 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f02310 sp=0xc440f02268 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f023a8, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f02378 sp=0xc440f02310 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f023d8 sp=0xc440f02378 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f02480 sp=0xc440f023d8 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f02518, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f024e8 sp=0xc440f02480 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f02548 sp=0xc440f024e8 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f025f0 sp=0xc440f02548 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f02688, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f02658 sp=0xc440f025f0 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f026b8 sp=0xc440f02658 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f02760 sp=0xc440f026b8 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f027f8, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f027c8 sp=0xc440f02760 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f02828 sp=0xc440f027c8 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f028d0 sp=0xc440f02828 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f02968, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f02938 sp=0xc440f028d0 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f02998 sp=0xc440f02938 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f02a40 sp=0xc440f02998 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f02ad8, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f02aa8 sp=0xc440f02a40 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f02b08 sp=0xc440f02aa8 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f02bb0 sp=0xc440f02b08 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f02c48, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f02c18 sp=0xc440f02bb0 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f02c78 sp=0xc440f02c18 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f02d20 sp=0xc440f02c78 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f02db8, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f02d88 sp=0xc440f02d20 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f02de8 sp=0xc440f02d88 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f02e90 sp=0xc440f02de8 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f02f28, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f02ef8 sp=0xc440f02e90 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f02f58 sp=0xc440f02ef8 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f03000 sp=0xc440f02f58 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f03098, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f03068 sp=0xc440f03000 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f030c8 sp=0xc440f03068 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f03170 sp=0xc440f030c8 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f03208, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f031d8 sp=0xc440f03170 pc=0x5ea97f
cmd/go/internal/work.(*Builder).CompileAction(0xc42027dc20, 0x0, 0x0, 0xc420083c00, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440f03238 sp=0xc440f031d8 pc=0x5eaba0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x82cea0)
        /usr/local/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440f032e0 sp=0xc440f03238 pc=0x61f0be
cmd/go/internal/work.(*Builder).cacheAction(0xc42027dc20, 0x8a7012, 0x5, 0xc420083c00, 0xc440f03378, 0x1)
        /usr/local/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440f03348 sp=0xc440f032e0 pc=0x5ea97f
...additional frames elided...

goroutine 5 [syscall]:
os/signal.signal_recv(0x0)
        /usr/local/go/src/runtime/sigqueue.go:139 +0xa6
os/signal.loop()
        /usr/local/go/src/os/signal/signal_unix.go:22 +0x22
created by os/signal.init.0
        /usr/local/go/src/os/signal/signal_unix.go:28 +0x41

@odeke-em odeke-em changed the title from Stack overflow when trying to run go test -race with -coverpkg=all to cmd/go: Stack overflow on running: go test -race with -coverpkg=all Feb 4, 2018

@odeke-em

This comment has been minimized.

Member

odeke-em commented Feb 4, 2018

Hello @drakonka, thank you for the bug report!

So interestingly I was able to first reproduce this issue in succession using Go 15 commits behind tip bcc86d5 where the latest Go tip is at 10d096f. However on pulling from master, rebuilding Go to ensure that it also exists on the latest, I can now no longer reproduce, even jumping back 15 commits back(where I originally was). I suspect this is something related to caching and in deed, the erroring stack trace originates from caching code in

a := b.cacheAction("build", p, func() *Action {
a := &Action{
Mode: "build",
Package: p,
Func: (*Builder).build,
Objdir: b.NewObjdir(),
}

/cc @rsc for some eyes and ideas

@rsc perhaps you might not like this suggestion but I suspect if @drakonka clears their test cache this issue will disappear(@drakonka please don't yet clear your cache :)). @rsc might you know if we have a command for them to upload their test cache for inspection?

@ianlancetaylor ianlancetaylor added this to the Go1.10 milestone Feb 5, 2018

@ianlancetaylor

This comment has been minimized.

Contributor

ianlancetaylor commented Feb 5, 2018

This is a bug when using -coverpkg=all and -covermode=atomic with a package that imports sync/atomic. It triggers when using -race because that implies -covermode=atomic. Using -covermode=atomic means that the coverage code itself relies on importing sync/atomic. Using -coverpkg=all implies that we should applies coverage to sync/atomic. That gives us a circular dependency. I'll send a patch.

@gopherbot

This comment has been minimized.

gopherbot commented Feb 5, 2018

Change https://golang.org/cl/91875 mentions this issue: cmd/go: ignore coverpkg match on sync/atomic in atomic coverage mode

@gopherbot

This comment has been minimized.

gopherbot commented Feb 5, 2018

Change https://golang.org/cl/92075 mentions this issue: cmd/go: only run -race test if -race works

gopherbot pushed a commit that referenced this issue Feb 5, 2018

cmd/go: only run -race test if -race works
Updates #23694

Change-Id: I5fdad8cceacb8bbc85ca2661eb6482aa80343656
Reviewed-on: https://go-review.googlesource.com/92075
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment