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: go list -json: stuck in cyclic import graph #24086

Closed
alandonovan opened this issue Feb 23, 2018 · 1 comment
Closed

cmd/go: go list -json: stuck in cyclic import graph #24086

alandonovan opened this issue Feb 23, 2018 · 1 comment
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@alandonovan
Copy link
Contributor

alandonovan commented Feb 23, 2018

$ go version
go version devel +a66af7280d Wed Feb 21 21:23:08 2018 +0000 linux/amd64
$ cat ~/go/src/app/app.go 
package main

import _ "test"
$ cat ~/go/src/test/test.go 
package test

import _ "test" // self-cycle in import graph
$ go list app test
can't load package: import cycle not allowed
package app
        imports test
        imports test
app
$ go list -e app test
app
test
$ go list -json app test
can't load package: import cycle not allowed
package app
        imports test
        imports test
^C                
$ go list -e -json app test
^C

The two interrupted (^C) runs got stuck in an infinite loop.

The unit of repetition seems to be:

cmd/go/internal/work.(*Builder).CompileAction(0xc00017d360, 0x1, 0x1, 0xc00021a000, 0x0)
        src/cmd/go/internal/work/action.go:330 +0xc0
cmd/go/internal/work.(*Builder).CompileAction.func1(0x8333c0)
        src/cmd/go/internal/work/action.go:339 +0x16e
cmd/go/internal/work.(*Builder).cacheAction(0xc00017d360, 0x8ad81b, 0x5, 0xc00021a000, 0xc0012799e0, 0x40c4d8)
        src/cmd/go/internal/work/action.go:300 +0x9f

It happens for 2-node cycles too.

@bradfitz bradfitz changed the title go list -json: stuck in cyclic import graph cmd/go: go list -json: stuck in cyclic import graph Feb 23, 2018
@bradfitz bradfitz added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 23, 2018
@bradfitz bradfitz added this to the Go1.11 milestone Feb 23, 2018
@gopherbot
Copy link

Change https://golang.org/cl/108016 mentions this issue: cmd/go: avoid infinite loop in go list -json -e on import cycle

@golang golang locked and limited conversation to collaborators Apr 25, 2019
@rsc rsc removed their assignment Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge 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

4 participants