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 when running #52

Closed
mvrhov opened this issue May 9, 2024 · 1 comment · Fixed by #55
Closed

Panic when running #52

mvrhov opened this issue May 9, 2024 · 1 comment · Fixed by #55
Labels
bug Something isn't working

Comments

@mvrhov
Copy link

mvrhov commented May 9, 2024

I got the panic bellow on two projects.
Now both of those projects use cgo and a modules in private repositories in go.mod. Bu I'm pretty sure that the modules in private repositories are at fault as I have another project without cgo but with modules in private repository.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x750b3d]

goroutine 38 [running]:
github.com/nieomylnieja/go-libyear/internal.(*GitHandler).listAllTags(0x0?, 0xc000224040?)
	/srv/go/pkg/mod/github.com/nieomylnieja/[email protected]/internal/git_handler.go:194 +0x1d
github.com/nieomylnieja/go-libyear/internal.(*GitHandler).GetInfo(0xc000194040, {0xc000224040, 0x1b}, 0xc000256190)
	/srv/go/pkg/mod/github.com/nieomylnieja/[email protected]/internal/git_handler.go:143 +0x4f
github.com/nieomylnieja/go-libyear.Command.runForModule({{0x8acc80, 0xc00020a300}, {0x8acce0, 0xb95a80}, {0x8afd98, 0xc0002120b0}, {0x8acec0, 0xc000222000}, 0x0, 0xc000220090, ...}, ...)
	/srv/go/pkg/mod/github.com/nieomylnieja/[email protected]/command.go:119 +0x122
github.com/nieomylnieja/go-libyear.Command.Run.func2()
	/srv/go/pkg/mod/github.com/nieomylnieja/[email protected]/command.go:75 +0x3b
golang.org/x/sync/errgroup.(*Group).Go.func1()
	/srv/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:78 +0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1
	/srv/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x96

nieomylnieja added a commit that referenced this issue May 18, 2024
The current implementation returns the last handler even if it can't
handle the repo, leading to a nil pointer exception.

Fixes #52

Co-authored-by: Mateusz Hawrus <[email protected]>
@nieomylnieja
Copy link
Owner

Thanks for reporting the issue @mvrhov and thanks @Crocmagnon for fixing it :)
I will release v0.4.2 today with these fixes.

@nieomylnieja nieomylnieja added the bug Something isn't working label May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants