git-subtrac
git-subtrac copied to clipboard
Segfault from `update`
Hey! I've run into a segfault when trying to do git subtrac update
:
Scanning branch: refs/heads/master
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x78d56c]
goroutine 1 [running]:
github.com/apenwarr/git-subtrac/subtrac.(*Cache).tracCommit(0xc0000e0a80, 0xc0007eba40, 0x34, 0xc0003aea50, 0xc081097bde, 0xc0003aea50, 0x0)
/path/to/src/gopath/src/github.com/apenwarr/git-subtrac/subtrac/subtrac.go:229 +0xf6c
github.com/apenwarr/git-subtrac/subtrac.(*Cache).tracTree(0xc0000e0a80, 0xc000135c50, 0x24, 0xc00007a870, 0x6, 0x85fa1e, 0x1)
/path/to/src/gopath/src/github.com/apenwarr/git-subtrac/subtrac/subtrac.go:547 +0xd78
github.com/apenwarr/git-subtrac/subtrac.(*Cache).tracTree(0xc0000e0a80, 0xc000023c60, 0x1d, 0xc00007a7d0, 0x6, 0x85fa1e, 0x1)
/path/to/src/gopath/src/github.com/apenwarr/git-subtrac/subtrac/subtrac.go:562 +0x43f
github.com/apenwarr/git-subtrac/subtrac.(*Cache).tracTree(0xc0000e0a80, 0xc000023be0, 0x16, 0xc00007a6e0, 0x3, 0x85fa1e, 0x1)
/path/to/src/gopath/src/github.com/apenwarr/git-subtrac/subtrac/subtrac.go:562 +0x43f
github.com/apenwarr/git-subtrac/subtrac.(*Cache).tracTree(0xc0000e0a80, 0xc000023b00, 0x12, 0xc00007a5f0, 0x1, 0xc000023b00, 0x12)
/path/to/src/gopath/src/github.com/apenwarr/git-subtrac/subtrac/subtrac.go:562 +0x43f
github.com/apenwarr/git-subtrac/subtrac.(*Cache).tracCommit(0xc0000e0a80, 0xc000028469, 0x11, 0xc0001720f0, 0xc013dabada, 0xc0001720f0, 0x0)
/path/to/src/gopath/src/github.com/apenwarr/git-subtrac/subtrac/subtrac.go:217 +0x2e6
github.com/apenwarr/git-subtrac/subtrac.(*Cache).TracByRef(0xc0000e0a80, 0xc000028469, 0x11, 0x1, 0x1, 0xc000028469)
/path/to/src/gopath/src/github.com/apenwarr/git-subtrac/subtrac/subtrac.go:188 +0x2eb
github.com/apenwarr/git-subtrac/subtrac.(*Cache).UpdateBranchRefs.func1(0xc000035b40, 0xc000035b40, 0x0)
/path/to/src/gopath/src/github.com/apenwarr/git-subtrac/subtrac/subtrac.go:143 +0x150
github.com/go-git/go-git/plumbing/storer.(*referenceFilteredIter).ForEach(0xc00000fbe0, 0xc00000fc40, 0x0, 0x0)
/path/to/src/gopath/src/github.com/go-git/go-git/plumbing/storer/reference.go:82 +0xa4
github.com/apenwarr/git-subtrac/subtrac.(*Cache).UpdateBranchRefs(0xc0000e0a80, 0xc00000e080, 0x2)
/path/to/src/gopath/src/github.com/apenwarr/git-subtrac/subtrac/subtrac.go:137 +0x1a6
main.main()
/path/to/src/gopath/src/github.com/apenwarr/git-subtrac/git-subtrac.go:77 +0x6eb
I'm a bit lost how to diagnose what went wrong ...
This error started showing up after I tried using --depth
on a git submodule add
so I suspect it is somehow related to that. I did however completely remove the submodule again and tried recreating it without --depth
. This did not fix it, unfortunately :(
Any idea A) what might have gone wrong here and B) how I can fix my repo so it works again?
Okay, I at least got my repo fixed again by aggressively wiping anything related to the submodule from its history ... Not sure what exactly helped, but at least I can now continue working with it :)
I had a very similar looking crash trying to do update on a tree where the super project is shallow with commits going back about 18 months, and the submodules are all depth 1. I haven't investigated whether it's the shallowness that's causing the crash, so that might be a red-herring.