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

cmd/go: stack overflow in TryBots tests of tools CL #29343

Closed
jayconrod opened this issue Dec 19, 2018 · 3 comments
Closed

cmd/go: stack overflow in TryBots tests of tools CL #29343

jayconrod opened this issue Dec 19, 2018 · 3 comments
Labels
FrozenDueToAge GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@jayconrod
Copy link
Contributor

jayconrod commented Dec 19, 2018

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

25ca8f49c3fc4a68daff7a23ab613e3453be5cda (tag: go1.10.6)

Does this issue reproduce with the latest release?

Unknown

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

linux_amd64
linux_amd64_race

What did you do?

Ran TryBots on CL 153443.

What did you expect to see?

Successful go list invocation as part of the LSP tests.

What did you see instead?

Full log at https://storage.googleapis.com/go-build-log/25ca8f49/linux-amd64_52d77f39.log

...
/tmp/TestLSP_GOPATH577657143/lsp/src/golang.org/x/tools/internal/lsp/godef/a /tmp/TestLSP_GOPATH577657143/lsp/src/golang.org/x/tools/internal/lsp/godef/b]: go [list -e -json -- golang.org/x/tools/internal/lsp/format golang.org/x/tools/internal/lsp/format golang.org/x/tools/internal/lsp/good golang.org/x/tools/internal/lsp/foo golang.org/x/tools/internal/lsp/rank golang.org/x/tools/internal/lsp/godef/broken golang.org/x/tools/internal/lsp/anon golang.org/x/tools/internal/lsp/bad golang.org/x/tools/internal/lsp/noparse_format golang.org/x/tools/internal/lsp/bar golang.org/x/tools/internal/lsp/selector golang.org/x/tools/internal/lsp/godef/b golang.org/x/tools/internal/lsp/baz golang.org/x/tools/internal/lsp/self golang.org/x/tools/internal/lsp/builtins golang.org/x/tools/internal/lsp/errors golang.org/x/tools/internal/lsp/noparse golang.org/x/tools/internal/lsp/complit golang.org/x/tools/internal/lsp/types golang.org/x/tools/internal/lsp/godef/b golang.org/x/tools/internal/lsp/bad golang.org/x/tools/internal/lsp/cast golang.org/x/tools/internal/lsp/rank golang.org/x/tools/internal/lsp/godef/a golang.org/x/tools/internal/lsp/good golang.org/x/tools/internal/lsp/godef/a golang.org/x/tools/internal/lsp/godef/b]: exit status 2: runtime: goroutine stack exceeds 1000000000-byte limit
    		fatal error: stack overflow

    		runtime stack:
    		runtime.throw(0x8b0531, 0xe)
    			/workdir/go/src/runtime/panic.go:616 +0x81
    		runtime.newstack()
    			/workdir/go/src/runtime/stack.go:1054 +0x71f
    		runtime.morestack()
    			/workdir/go/src/runtime/asm_amd64.s:480 +0x89
    		
    		goroutine 1 [running]:
    		fmt.(*fmt).pad(0xc420020340, 0xc4200203a5, 0x7, 0x7)
    			/workdir/go/src/fmt/format.go:90 +0x3a9 fp=0xc440978350 sp=0xc440978348 pc=0x4bff39
    		fmt.(*fmt).fmt_integer(0xc420020340, 0x1642e5, 0xa, 0x1, 0x8b15c4, 0x11)
    			/workdir/go/src/fmt/format.go:307 +0x1db fp=0xc4409783a0 sp=0xc440978350 pc=0x4c08fb
    		fmt.(*pp).fmtInteger(0xc420020300, 0x1642e5, 0x6400000001)
    			/workdir/go/src/fmt/print.go:369 +0x1e5 fp=0xc4409783e0 sp=0xc4409783a0 pc=0x4c4105
    		fmt.(*pp).printArg(0xc420020300, 0x810840, 0xc46140a5e0, 0x64)
    			/workdir/go/src/fmt/print.go:649 +0x837 fp=0xc440978458 sp=0xc4409783e0 pc=0x4c6717
    		fmt.(*pp).doPrintf(0xc420020300, 0x8ab96a, 0x5, 0xc4409785d0, 0x1, 0x1)
    			/workdir/go/src/fmt/print.go:1099 +0x3fa fp=0xc440978540 sp=0xc440978458 pc=0x4c9ada
    		fmt.Sprintf(0x8ab96a, 0x5, 0xc4409785d0, 0x1, 0x1, 0x20, 0x0)
    			/workdir/go/src/fmt/print.go:203 +0x66 fp=0xc440978598 sp=0xc440978540 pc=0x4c2c26
    		cmd/go/internal/work.(*Builder).NewObjdir(0xc4200fe640, 0x25c65caae221ea49, 0x8)
    			/workdir/go/src/cmd/go/internal/work/action.go:257 +0x94 fp=0xc440978610 sp=0xc440978598 pc=0x5ea314
    		cmd/go/internal/work.(*Builder).CompileAction.func1(0x831da0)
    			/workdir/go/src/cmd/go/internal/work/action.go:335 +0x53 fp=0xc4409786b8 sp=0xc440978610 pc=0x621143
    		cmd/go/internal/work.(*Builder).cacheAction(0xc4200fe640, 0x8ab988, 0x5, 0xc4203ed800, 0xc440978750, 0x412138)
    			/workdir/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440978720 sp=0xc4409786b8 pc=0x5eabef
    		cmd/go/internal/work.(*Builder).CompileAction(0xc4200fe640, 0x1, 0x1, 0xc4203ed800, 0xc4409787d0)
    			/workdir/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440978780 sp=0xc440978720 pc=0x5eae10
    		cmd/go/internal/work.(*Builder).CompileAction.func1(0x831da0)
    			/workdir/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440978828 sp=0xc440978780 pc=0x62125e
    		cmd/go/internal/work.(*Builder).cacheAction(0xc4200fe640, 0x8ab988, 0x5, 0xc4203ed800, 0xc4409788c0, 0x412138)
    			/workdir/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440978890 sp=0xc440978828 pc=0x5eabef
    		cmd/go/internal/work.(*Builder).CompileAction(0xc4200fe640, 0x1, 0x1, 0xc4203ed800, 0xc440978940)
    			/workdir/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc4409788f0 sp=0xc440978890 pc=0x5eae10
    		cmd/go/internal/work.(*Builder).CompileAction.func1(0x831da0)
    			/workdir/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440978998 sp=0xc4409788f0 pc=0x62125e
    		cmd/go/internal/work.(*Builder).cacheAction(0xc4200fe640, 0x8ab988, 0x5, 0xc4203ed800, 0xc440978a30, 0x412138)
    			/workdir/go/src/cmd/go/internal/work/action.go:300 +0x9f fp=0xc440978a00 sp=0xc440978998 pc=0x5eabef
    		cmd/go/internal/work.(*Builder).CompileAction(0xc4200fe640, 0x1, 0x1, 0xc4203ed800, 0xc440978ab0)
    			/workdir/go/src/cmd/go/internal/work/action.go:330 +0xc0 fp=0xc440978a60 sp=0xc440978a00 pc=0x5eae10
    		cmd/go/internal/work.(*Builder).CompileAction.func1(0x831da0)
    			/workdir/go/src/cmd/go/internal/work/action.go:339 +0x16e fp=0xc440978b08 sp=0xc440978a60 pc=0x62125e
...
@jayconrod jayconrod added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. GoCommand cmd/go labels Dec 19, 2018
@jayconrod jayconrod added this to the Go1.12 milestone Dec 19, 2018
@jayconrod jayconrod self-assigned this Dec 19, 2018
@jayconrod
Copy link
Contributor Author

Originally reported by @stamblerre

@jayconrod
Copy link
Contributor Author

I was able to reproduce this in 1.10.6 with go list -e -json <pkg> where <pkg> is a package that imports itself. The problem is that go list builds a dependency graph of packages (which in this case is cyclic), and then compiles part of it (in order to show paths in the JSON output). The build system isn't prepared to deal with a cyclic graph.

This seems to be fixed in 1.11.4 and on master. go list prints a package with "import cycle not allowed". I'm assuming we're not going to cherry-pick the fix for another 1.10 point release, so closing.

@stamblerre You might be able to work around this with // +build go1.11.

@stamblerre
Copy link
Contributor

thanks for investigating, @jayconrod!

@golang golang locked and limited conversation to collaborators Dec 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants