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: infinite loop when an import path starts with / #42891

Closed
heschi opened this issue Nov 30, 2020 · 1 comment
Closed

cmd/go: infinite loop when an import path starts with / #42891

heschi opened this issue Nov 30, 2020 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@heschi
Copy link
Contributor

heschi commented Nov 30, 2020

@leitzler reported an infinite loop in the go command when an import path starts with /. The stack trace implicates the loop that calls path.Dir in cmd/go/internal/modload.keepSums, which terminates on .. That assumes that the import path is "relative". If the path happens to start with a slash, the path is "absolute" and the fixed point for path.Dir is /, not ., and the loop is infinite.

cc @jayconrod, who added this code in https://golang.org/cl/262781. FWIW, when I wrote a version of this somewhere I did it such that it terminated when path.Dir(s) == s.

@heschi heschi added NeedsFix The path to resolution is known, but the work has not been done. release-blocker labels Nov 30, 2020
@heschi heschi added this to the Go1.16 milestone Nov 30, 2020
@jayconrod jayconrod self-assigned this Nov 30, 2020
@gopherbot
Copy link

Change https://golang.org/cl/274172 mentions this issue: cmd/go: fix infinite loop in modload.keepSums

@golang golang locked and limited conversation to collaborators Nov 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge 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

3 participants