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

Panic while cloning repo #236

Open
sirnewton01 opened this issue Mar 11, 2019 · 7 comments
Open

Panic while cloning repo #236

sirnewton01 opened this issue Mar 11, 2019 · 7 comments
Labels

Comments

@sirnewton01
Copy link
Collaborator

While trying to get the remainder of the t5510-fetch tests running there are a number of clone operations that are panicking with the following error. It appears that an unexpected index pack type of 'tag' is being found.

panic: Unhandled type in IndexPack: tag

goroutine 1 [running]:
github.com/driusan/dgit/git.IndexPack(0xc000086420, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/Users/cmcgee/go/src/github.com/driusan/dgit/git/indexpack.go:711 +0x1e39
github.com/driusan/dgit/git.IndexAndCopyPack(0xc000086420, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/Users/cmcgee/go/src/github.com/driusan/dgit/git/indexpack.go:730 +0x7a
github.com/driusan/dgit/git.fetchPackDone(0xc000086420, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x100000000000000, 0x148ca00, 0xc000010b00, ...)
	/Users/cmcgee/go/src/github.com/driusan/dgit/git/fetchpack.go:294 +0xc9c
github.com/driusan/dgit/git.FetchPack(0xc000086420, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x100000000000000, 0x7ffeefbff350, 0x1, ...)
	/Users/cmcgee/go/src/github.com/driusan/dgit/git/fetchpack.go:67 +0x336
github.com/driusan/dgit/git.Clone(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, ...)
	/Users/cmcgee/go/src/github.com/driusan/dgit/git/clone.go:61 +0x183
github.com/driusan/dgit/cmd.Clone(0xc000086360, 0xc0000101a0, 0x2, 0x2, 0xffffffffffffffff, 0x0)
	/Users/cmcgee/go/src/github.com/driusan/dgit/cmd/clone.go:60 +0x52a
main.main()
	/Users/cmcgee/go/src/github.com/driusan/dgit/main.go:215 +0x4818
@driusan
Copy link
Owner

driusan commented Mar 11, 2019

Annotated tags are a normal thing to be in pack files, we probably just never added support?

@sirnewton01
Copy link
Collaborator Author

Yes, it looks like it. Check indexpack.go around line 711. There's no case for tags.

driusan added a commit that referenced this issue Mar 13, 2019
Fix an off by one error in the fanout table lookup in HaveObject,
which would result in dgit incorrectly reporting that any hash that
starts with a 0 wasn't present in the pack.

Should fix #236.
@sirnewton01
Copy link
Collaborator Author

@driusan in order to add tag support for index pack, is it just a matter of putting OBJ_TAG in the switch statement here or is there special processing needed for tags?

case OBJ_COMMIT, OBJ_TREE, OBJ_BLOB:

@driusan
Copy link
Owner

driusan commented Mar 13, 2019

I'm not sure.. I think there's a reasonably good chance it's just a matter of adding OBJ_TAG there, but I may be forgetting about something. You can try it and see.

@sirnewton01
Copy link
Collaborator Author

Unfortunately, it's not that simple. Now the fetch tests begin failing with an index out of bounds on indexpack.go:452

Where can one learn more about how the indexing format here so that a more intelligent patch can be made?

@driusan
Copy link
Owner

driusan commented Mar 13, 2019

The index format is defined in https://github.com/git/git/blob/master/Documentation/technical/pack-format.txt , but I doubt it'll help much. There's probably one or two other similar switch statements in dgit (or switching on their string equivalent) and not a problem with the index itself

@driusan
Copy link
Owner

driusan commented Aug 29, 2019

This is causing Travis to fail now because one of the go get tests needs annotated tags.

ie in #254

go: finding golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e

go: golang.org/x/[email protected]: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /tmp/gopath.7857/pkg/mod/cache/vcs/b44680b3c3708a854d4c89f55aedda0b223beb8d9e30fba969cefb5bd9c1e843: exit status 2:

	remote: Sending approximately 15.27 MiB ...

remote: Counting objects: 33, done

remote: Finding sources: 100% (29/29)

Indexing objects: 12% (3650/30685)panic: Unhandled type in IndexPack: tag

	

	goroutine 1 [running]:

	github.com/driusan/dgit/git.IndexPack(0xc0000963c0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)

		/home/travis/gopath/src/github.com/driusan/dgit/git/indexpack.go:711 +0x1e39

	github.com/driusan/dgit/git.IndexAndCopyPack(0xc0000963c0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)

		/home/travis/gopath/src/github.com/driusan/dgit/git/indexpack.go:730 +0x7a

	github.com/driusan/dgit/git.fetchPackDone(0xc0000963c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x100000000000000, 0x889b80, 0xc00012e100, ...)

		/home/travis/gopath/src/github.com/driusan/dgit/git/fetchpack.go:294 +0xc9c

	github.com/driusan/dgit/git.FetchPack(0xc0000963c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x100000000000000, 0x7ffe9ce75519, 0x6, ...)

		/home/travis/gopath/src/github.com/driusan/dgit/git/fetchpack.go:67 +0x336

	github.com/driusan/dgit/git.Fetch(0xc0000963c0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x100000000000000, 0x7ffe9ce75519, ...)

		/home/travis/gopath/src/github.com/driusan/dgit/git/fetch.go:33 +0x1d6

	github.com/driusan/dgit/cmd.Fetch(0xc0000963c0, 0xc000096140, 0x4, 0x4, 0x0, 0x0)

		/home/travis/gopath/src/github.com/driusan/dgit/cmd/fetch.go:54 +0x2c7

	main.main()

		/home/travis/gopath/src/github.com/driusan/dgit/main.go:228 +0x4aeb

go: error loading module requirements

Go get failed

The command "./go-get-modules-tests.sh" exited with 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants