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

Log hangs infinitely on certain commit in git/git #912

Closed
vmarkovtsev opened this issue Aug 9, 2018 · 3 comments
Closed

Log hangs infinitely on certain commit in git/git #912

vmarkovtsev opened this issue Aug 9, 2018 · 3 comments

Comments

@vmarkovtsev
Copy link
Contributor

I run Repository.Log over git/git using the master revision of go-git.

// repository is cloned from git/git

cit, err := repository.Log(&git.LogOptions{From: plumbing.ZeroHash})
if err != nil {
	log.Fatalf("unable to collect the commit history: %v", err)
}
defer cit.Close()
cit.ForEach(func(commit *object.Commit) error {
	log.Println(commit.Hash.String())
})

This prints 27894 hashes and finally gets stuck on ae03ee644ec52f2aa2769dfd4929c5ff85c2a899 eating 100% CPU.

@vmarkovtsev
Copy link
Contributor Author

Stack traces on SIGQUIT-s:

goroutine 1 [running]:
bufio.(*Reader).ReadBytes(0xc42973f830, 0xc428aedc0a, 0x1c2, 0x0, 0x0, 0xc428aedc20, 0x1c2)
	/usr/lib/go-1.9/src/bufio/bufio.go:416 +0x7a fp=0xc42973f620 sp=0xc42973f530 pc=0x89266a
gopkg.in/src-d/go-git.v4/plumbing/object.(*Commit).Decode(0xc4261614a0, 0x1c6d260, 0xc42693a640, 0x0, 0x0)
	/home/vadim/Projects/hercules/src/gopkg.in/src-d/go-git.v4/plumbing/object/commit.go:178 +0x236 fp=0xc42973f898 sp=0xc42973f620 pc=0xafb516
gopkg.in/src-d/go-git.v4/plumbing/object.DecodeCommit(0x7effc7ca62d8, 0xc4202802a0, 0x1c6d260, 0xc42693a640, 0x0, 0xc42641c0a0, 0xc42641c200)
	/home/vadim/Projects/hercules/src/gopkg.in/src-d/go-git.v4/plumbing/object/commit.go:66 +0x81 fp=0xc42973f8d8 sp=0xc42973f898 pc=0xafa901
gopkg.in/src-d/go-git.v4/plumbing/object.(*storerCommitIter).Next(0xc4279e1440, 0xc4209dc510, 0x1c68720, 0xc4279e1440)
	/home/vadim/Projects/hercules/src/gopkg.in/src-d/go-git.v4/plumbing/object/commit.go:395 +0x92 fp=0xc42973f920 sp=0xc42973f8d8 pc=0xafd9a2
gopkg.in/src-d/go-git.v4/plumbing/object.(*commitPreIterator).Next(0xc4209dc570, 0x0, 0x0, 0x0)
	/home/vadim/Projects/hercules/src/gopkg.in/src-d/go-git.v4/plumbing/object/commit_walker.go:55 +0x2da fp=0xc42973f9c8 sp=0xc42973f920 pc=0xafe0aa
gopkg.in/src-d/go-git.v4/plumbing/object.(*commitPreIterator).ForEach(0xc4209dc570, 0xc42012ae70, 0xc4209dc570, 0xc4209dc570)
	/home/vadim/Projects/hercules/src/gopkg.in/src-d/go-git.v4/plumbing/object/commit_walker.go:95 +0x2f fp=0xc42973fa10 sp=0xc42973f9c8 pc=0xafe59f
gopkg.in/src-d/hercules.v4/internal/core.(*Pipeline).Commits(0xc4201a3c28, 0x0, 0x0, 0x0)
	/home/vadim/Projects/hercules/src/gopkg.in/src-d/hercules.v4/internal/core/pipeline.go:374 +0x215 fp=0xc42973fab8 sp=0xc42973fa10 pc=0xd1ef65
main.glob..func3(0x1c55920, 0xc4201cfac0, 0x1, 0x4)
goroutine 1 [runnable]:
gopkg.in/src-d/go-git.v4/plumbing/object.(*Commit).Decode(0xc4216fb4a0, 0x1c6d260, 0xc426cabc40, 0x0, 0x0)
	/home/vadim/Projects/hercules/src/gopkg.in/src-d/go-git.v4/plumbing/object/commit.go:191 +0x431
gopkg.in/src-d/go-git.v4/plumbing/object.DecodeCommit(0x7f016bd771e8, 0xc4202802a0, 0x1c6d260, 0xc426cabc40, 0x0, 0xc4284f1ee0, 0xc423040140)
	/home/vadim/Projects/hercules/src/gopkg.in/src-d/go-git.v4/plumbing/object/commit.go:66 +0x81
gopkg.in/src-d/go-git.v4/plumbing/object.(*storerCommitIter).Next(0xc4282ad3e0, 0xc4201d71a0, 0x1c68720, 0xc4282ad3e0)
	/home/vadim/Projects/hercules/src/gopkg.in/src-d/go-git.v4/plumbing/object/commit.go:395 +0x92
gopkg.in/src-d/go-git.v4/plumbing/object.(*commitPreIterator).Next(0xc4201d7260, 0x0, 0x0, 0x0)
	/home/vadim/Projects/hercules/src/gopkg.in/src-d/go-git.v4/plumbing/object/commit_walker.go:55 +0x2da
gopkg.in/src-d/go-git.v4/plumbing/object.(*commitPreIterator).ForEach(0xc4201d7260, 0xc42012ce70, 0xc4201d7260, 0xc4201d7260)
	/home/vadim/Projects/hercules/src/gopkg.in/src-d/go-git.v4/plumbing/object/commit_walker.go:95 +0x2f
gopkg.in/src-d/hercules.v4/internal/core.(*Pipeline).Commits(0xc4201a3c28, 0x0, 0x0, 0x0)
	/home/vadim/Projects/hercules/src/gopkg.in/src-d/hercules.v4/internal/core/pipeline.go:374 +0x215
main.glob..func3(0x1c55920, 0xc4201cfa80, 0x1, 0x4)

@smola
Copy link
Collaborator

smola commented Aug 10, 2018

@smola smola closed this as completed Aug 10, 2018
@vmarkovtsev
Copy link
Contributor Author

Sorry, I haven't noticed that

git remote -v
origin	https://gopkg.in/src-d/go-git.v4 (fetch)
origin	https://gopkg.in/src-d/go-git.v4 (push)

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

No branches or pull requests

2 participants