Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

panic at gps/vcs_source:301 #1379

@Civil

Description

@Civil

What version of dep are you using (dep version)?

devel@2b7a08040ebc4699bfbd38128e9887eeb3092168

What dep command did you run?

dep init

What did you expect to see?

It should run fine

What did you see instead?

vsmirnov@C02PK283FVH6 ~/go/gopath_third_party/src/gitlab.[somecompany]/[some]/[repo] $ ~/go/gopath_third_party/src/github.com/golang/dep/cmd/dep/dep init
panic: runtime error: slice bounds out of range

goroutine 91 [running]:
github.com/golang/dep/gps.(*gitSource).listVersions(0xc420422110, 0x1771200, 0xc4203981e0, 0xc4204b4900, 0x10127b8, 0x10, 0x14aaee0, 0xc4204b4901)
	/Users/vsmirnov/go/gopath_third_party/src/github.com/golang/dep/gps/vcs_source.go:301 +0x1392
github.com/golang/dep/gps.maybeGitSource.try.func1(0x1771200, 0xc4203981e0, 0x1770f00, 0xc420063340)
	/Users/vsmirnov/go/gopath_third_party/src/github.com/golang/dep/gps/maybe_source.go:97 +0x71
github.com/golang/dep/gps.(*supervisor).do(0xc420067140, 0x1770f40, 0xc42001c040, 0x151aeca, 0xc, 0x1, 0xc4204b4a68, 0xc42050c038, 0x0)
	/Users/vsmirnov/go/gopath_third_party/src/github.com/golang/dep/gps/source_manager.go:657 +0xd5
github.com/golang/dep/gps.maybeGitSource.try(0xc42009ac80, 0x1770f40, 0xc42001c040, 0xc4200195f0, 0x2d, 0x1773d60, 0xc420398190, 0xc420067140, 0x30, 0x30, ...)
	/Users/vsmirnov/go/gopath_third_party/src/github.com/golang/dep/gps/maybe_source.go:95 +0x20f
github.com/golang/dep/gps.(*sourceGateway).require(0xc420254480, 0x1770f40, 0xc42001c040, 0x1, 0x50, 0x0, 0x0)
	/Users/vsmirnov/go/gopath_third_party/src/github.com/golang/dep/gps/source.go:571 +0x210
github.com/golang/dep/gps.(*sourceGateway).sourceURL(0xc420254480, 0x1770f40, 0xc42001c040, 0x0, 0x0, 0x0, 0x0)
	/Users/vsmirnov/go/gopath_third_party/src/github.com/golang/dep/gps/source.go:539 +0xb5
github.com/golang/dep/gps.(*sourceCoordinator).getSourceGatewayFor(0xc420181ab0, 0x1770f40, 0xc42001c040, 0xc42001a410, 0x1f, 0x0, 0x0, 0x0, 0x0, 0x0)
	/Users/vsmirnov/go/gopath_third_party/src/github.com/golang/dep/gps/source.go:205 +0x9f7
github.com/golang/dep/gps.(*SourceMgr).SyncSourceFor(0xc4200671a0, 0xc42001a410, 0x1f, 0x0, 0x0, 0x0, 0x0)
	/Users/vsmirnov/go/gopath_third_party/src/github.com/golang/dep/gps/source_manager.go:501 +0x82
github.com/golang/dep/gps.(*bridge).SyncSourceFor(0xc420256210, 0xc42001a410, 0x1f, 0x0, 0x0, 0xc42016b180, 0x1a)
	/Users/vsmirnov/go/gopath_third_party/src/github.com/golang/dep/gps/bridge.go:222 +0x5b
created by github.com/golang/dep/gps.(*solver).selectRoot
	/Users/vsmirnov/go/gopath_third_party/src/github.com/golang/dep/gps/solver.go:644 +0x614

Some extra information:
I've got custom ~/.gitconfig, it contains:

[url "git@gitlab.[somecompany]:"]
    insteadOf = https://gitlab.[somecompany]/

As a recommended workaround for corporate gitlab which requires ssh access to clone repos.

I've added a debug print before that line: fmt.Printf("SIZE: %v, LINE: %+v\n", len(pair), string(pair))

What I see just before panic:

SIZE: 59, LINE: 6cae4212beea4eeb8576347acac6418910cfda0f	refs/pull/99/merge
SIZE: 20, LINE: Killed by signal 1.

(Killed by signal 1 comes from ssh-proxy on a jump host).
If I add following code before 301 it works as expected:

                if len(pair) < 41 {
                        fmt.Printf("BUGBUG: strange pair version: '%v', len=%v\n", string(pair), len(pair))
                        continue
                }

It prints out:
', len=20trange pair version: 'Killed by signal 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions