commitlog icon indicating copy to clipboard operation
commitlog copied to clipboard

"segmentation violation" issue on executing generate command

Open MatteoGauthier opened this issue 2 years ago • 2 comments

Hey ! I got an issue by running commitlog generate after a fresh install

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x102fecdbc]

goroutine 1 [running]:
github.com/barelyhuman/commitlog/pkg.(*Generator).readCommitsInTags(0x140001b2140)
        /root/go/pkg/mod/github.com/barelyhuman/[email protected]/pkg/generator.go:91 +0x1bc
github.com/barelyhuman/commitlog/pkg.(*Generator).ReadCommmits(0x140001b2140)
        /root/go/pkg/mod/github.com/barelyhuman/[email protected]/pkg/generator.go:175 +0x4c
github.com/barelyhuman/commitlog/commands.Commitlog(0x14000136230?)
        /root/go/pkg/mod/github.com/barelyhuman/[email protected]/commands/commitlog.go:57 +0x538
main.main.func2(0x14000000a20?)
        /root/go/pkg/mod/github.com/barelyhuman/[email protected]/main.go:32 +0x1c
github.com/urfave/cli/v2.(*Command).Run(0x14000000a20, 0x1400010d840)
        /root/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:169 +0x4f8
github.com/urfave/cli/v2.(*App).RunContext(0x14000140680, {0x1031ffb90?, 0x103551e20}, {0x1400001e040, 0x2, 0x2})
        /root/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:341 +0x85c
github.com/urfave/cli/v2.(*App).Run(...)
        /root/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:247
main.main()
        /root/go/pkg/mod/github.com/barelyhuman/[email protected]/main.go:143 +0xc60

MatteoGauthier avatar Aug 30 '23 13:08 MatteoGauthier

Thanks for the report, I'm assuming the repository has no tags and that might have caused this issue, can you confirm if it throws at after adding a tag as well?

That should help debug , or I'd be fixing an unknown problem

Also, that looks like an older version of commitlog , can you try updating to the latest one?

curl -sLf https://goblin.run/github.com/barelyhuman/commitlog | sh

barelyhuman avatar Aug 30 '23 16:08 barelyhuman

Seems to be happening with the latest version as well, Should be fixed in v3.0.0

curl -sLf https://goblin.run/github.com/barelyhuman/commitlog/v3@v3 | sh

barelyhuman avatar Aug 30 '23 22:08 barelyhuman