cmd/go: infinite loop when an import path starts with / #42891
Labels
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
release-blocker
Milestone
@leitzler reported an infinite loop in the
go
command when an import path starts with/
. The stack trace implicates the loop that callspath.Dir
incmd/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 forpath.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
.The text was updated successfully, but these errors were encountered: