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

x/build/cmd/gitmirror: panic in parseRefs #29560

Open
dmitshur opened this Issue Jan 4, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@dmitshur
Copy link
Member

dmitshur commented Jan 4, 2019

Spotted the following crash due to a panic in gitmirror production logs. It happened once between December 13, 2018 and today, running version golang/build@a196f5a. Making an issue for future reference, but the urgency to fix it is not high.

[...]
2018/12/18 00:59:58 wrote /cache/golang-maintner/0044.growing.mutlog
2018/12/18 00:59:58 Reloaded data from log *maintner.netMutSource.
2018/12/18 00:59:58 Updating data from log *maintner.netMutSource ...
2018/12/18 00:59:58 Downloading 16535 bytes of https://maintner.golang.org/logs/44 ...
2018/12/18 00:59:58 wrote /cache/golang-maintner/0044.growing.mutlog
2018/12/18 00:59:58 Reloaded data from log *maintner.netMutSource.
2018/12/18 00:59:58 Updating data from log *maintner.netMutSource ...
2018/12/18 00:59:58 Downloading 517 bytes of https://maintner.golang.org/logs/44 ...
2018/12/18 00:59:58 wrote /cache/golang-maintner/0044.growing.mutlog
2018/12/18 00:59:59 gerrit code.googlesource.com/gocloud: Ref {CLNumber:36550 Version:0} => 9c82146fdb60bd3c20550b4338086d31be5308f6
2018/12/18 00:59:59 gerrit code.googlesource.com/gocloud: Ref {CLNumber:36270 Version:17} => 61be65d41596e538a13096fbfa3d54a0dfb5aaed
2018/12/18 00:59:59 gerrit code.googlesource.com/gocloud: Ref {CLNumber:36270 Version:0} => 818d367ffefe3962c5ce3514609e6eb09fa77b7e
2018/12/18 00:59:59 gerrit code.googlesource.com/gocloud: Ref {CLNumber:36590 Version:1} => 4dfd96393603a403058af13f23ce97c6b5216ebc
2018/12/18 00:59:59 gerrit code.googlesource.com/gocloud: Ref {CLNumber:36590 Version:0} => a20a43b1764b61da170128eb22c368033d724605
2018/12/18 00:59:59 Reloaded data from log *maintner.netMutSource.
2018/12/18 00:59:59 maintner refs for code.googlesource.com/gocloud changed
2018/12/18 00:59:59 Updating data from log *maintner.netMutSource ...
panic: runtime error: index out of range

goroutine 145 [running]:
main.parseRefs(0xc457e20580, 0xc420199bc0, 0x8ff693, 0x3)
        /go/src/golang.org/x/build/cmd/gitmirror/gitmirror.go:1533 +0x4c4
main.(*Repo).getRemoteRefs(0xc420475600, 0x8ff8ae, 0x4, 0x0, 0x0, 0x0)
        /go/src/golang.org/x/build/cmd/gitmirror/gitmirror.go:1514 +0x14a
main.(*Repo).push.func2(0x0, 0x10)
        /go/src/golang.org/x/build/cmd/gitmirror/gitmirror.go:1118 +0x255
main.try(0x3, 0xc440503dd8, 0xc42024fe08, 0xc420475600)
        /go/src/golang.org/x/build/cmd/gitmirror/gitmirror.go:1273 +0x6b
main.(*Repo).push(0xc420475600, 0x0, 0x0)
        /go/src/golang.org/x/build/cmd/gitmirror/gitmirror.go:1104 +0xbc
main.(*Repo).Loop(0xc420475600)
        /go/src/golang.org/x/build/cmd/gitmirror/gitmirror.go:576 +0x24f
main.runGitMirror.func1(0xc42047a4b0, 0xa, 0xc4203edbc0, 0x17, 0x0)
        /go/src/golang.org/x/build/cmd/gitmirror/gitmirror.go:216 +0x2ae
created by main.runGitMirror
        /go/src/golang.org/x/build/cmd/gitmirror/gitmirror.go:239 +0x5ee

The relevant line is x/build/cmd/gitmirror/gitmirror.go:1533.

To resolve this issue, the first step is to understand why and under what conditions it happens. Help is welcome.

@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Jan 4, 2019

Change https://golang.org/cl/156341 mentions this issue: cmd/gitmirror: prevent a panic and log on bogus ref line in parseRefs

gopherbot pushed a commit to golang/build that referenced this issue Jan 5, 2019

cmd/gitmirror: prevent a panic and log on bogus ref line in parseRefs
Updates golang/go#29560

Change-Id: I397b38af3dc421b5de6e6a799ad6b0e5ccab62f3
Reviewed-on: https://go-review.googlesource.com/c/156341
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>

@bradfitz bradfitz changed the title x/build/cmd/gitmirror: possible panic in parseRefs x/build/cmd/gitmirror: panic in parseRefs Jan 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.