warrensbox/tgswitch

Getting a SIGSEGV when running tgswitch

dontspamterry opened this issue · 11 comments

Hi, I just installed tgswitch via the curl instruction on Linux Mint 19.1 Cinnamon. The version installed is 0.4.315. When I run tgswitch, I get the following error:

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

goroutine 1 [running]:
github.com/warrensbox/tgswitch/lib.GetAppList(0x7cb598, 0x3e, 0xc0000d7f00, 0x0, 0x817740, 0xc00008f470, 0x1a, 0x1, 0xc00008b020)
/go/src/github.com/warrensbox/tgswitch/lib/list_versions.go:54 +0x321
main.main()
/go/src/github.com/warrensbox/tgswitch/main.go:115 +0x3e2

Anyone else seeing this? My version of Go is:

go version go1.13.5 linux/amd64

if that matters. I also downgraded to 0.3.308 and see the same issue

Any ideas what might be wrong with my setup? Thanks!

@dontspamterry
The version of Go on your machine should not matter.
It might have timed out while making an API call to terragrunt's GitHub repo. Can you try it again? Do you still see the error?

Hi all !

I also have same issue:

Reading required terragrunt version .tgswitchrc 
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x12fe7e1]

goroutine 1 [running]:
github.com/warrensbox/tgswitch/lib.GetAppList(0x13cf696, 0x3e, 0xc0000b5f00, 0x201, 0xc0003826d0, 0x7, 0x0, 0x0, 0xc0001260a0)
        /go/src/github.com/warrensbox/tgswitch/lib/list_versions.go:54 +0x321
main.main()
        /go/src/github.com/warrensbox/tgswitch/main.go:82 +0xc45

My go version is go version go1.13.8 darwin/amd64

What is in your .tgswitchrc file?
Can you try again? @jcolfej

.tgswitchrc contains 0.20.5

I try to uninstall tgswitch, rewrite .tgswitchrc file and reinstall tgswitch => everything's working again!

I think I've found the problem: a line break in the.tgswitchrc file.
My git tells me there is diff on .tgswitchrc: No newline at end of file

Hi there!

Faced the same issue on macOS 10.15.5 with go version go1.14.4 darwin/amd64.
tgswitch installed with brew package warrensbox/tap/tgswitch

I have tried to remove .tgswitchrc file, the result was the same

➜  ~ echo "0.23.31" >> .tgswitchrc
➜  ~ tgswitch
Reading required terragrunt version .tgswitchrc
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x12fea31]

goroutine 1 [running]:
github.com/warrensbox/tgswitch/lib.GetAppList(0x13cf9a8, 0x3e, 0xc0000b7f00, 0x201, 0xc0000786f0, 0x7, 0x0, 0x0, 0xc00006f050)
	/go/src/github.com/warrensbox/tgswitch/lib/list_versions.go:54 +0x321
main.main()
	/go/src/github.com/warrensbox/tgswitch/main.go:82 +0xcb0
➜  ~ tgswitch 0.23.31
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x12fea31]

goroutine 1 [running]:
github.com/warrensbox/tgswitch/lib.GetAppList(0x13cf9a8, 0x3e, 0xc000099f00, 0xc000065201, 0x0, 0x0, 0x1b, 0x1, 0xc00004b050)
	/go/src/github.com/warrensbox/tgswitch/lib/list_versions.go:54 +0x321
main.main()
	/go/src/github.com/warrensbox/tgswitch/main.go:97 +0x8dd

Hi!
Same with me

-> tgswitch
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x12fea31]

goroutine 1 [running]:
github.com/warrensbox/tgswitch/lib.GetAppList(0x13cf9a8, 0x3e, 0xc0000c1f00, 0xc00007f201, 0x0, 0x0, 0x18, 0x1, 0xc000079030)
/go/src/github.com/warrensbox/tgswitch/lib/list_versions.go:54 +0x321
main.main()
/go/src/github.com/warrensbox/tgswitch/main.go:97 +0x8dd

Just a +1 that this still seems to occur:

+ tgswitch -b /var/jenkins/tgswitch/0.28.7/terragrunt 0.28.7
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x6fb0c1]

goroutine 1 [running]:
github.com/warrensbox/tgswitch/lib.GetAppList(0x7cb5aa, 0x3e, 0xc0000c7f00, 0x1, 0x8177e0, 0xc00007d0b0, 0x43, 0x1, 0xc00007af70)
	/go/src/github.com/warrensbox/tgswitch/lib/list_versions.go:54 +0x321
main.main()
	/go/src/github.com/warrensbox/tgswitch/main.go:97 +0x8dd

@warrensbox we are having this same issue on MAC OS X, we are keen to use this tool. QQ is the project actively maintained?

me@Mac ~ $ go version
go version go1.16.5 darwin/amd64
me@Mac ~ $ sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.7

~ $ tgswitch
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x12fea31]

goroutine 1 [running]:
github.com/warrensbox/tgswitch/lib.GetAppList(0x13cf9a8, 0x3e, 0xc0000b5f00, 0x0, 0x141c300, 0xc0000730b0, 0x19, 0x1, 0xc00006f050)
/go/src/github.com/warrensbox/tgswitch/lib/list_versions.go:54 +0x321
main.main()
/go/src/github.com/warrensbox/tgswitch/main.go:115 +0x3e2

This due to the limitation of the API github provides. Each day, there can only be a certain number of calls to github. I have a way to fix this. I will work on it this week.

Xat59 commented

I have the same issue with tgswitch on MacOS :

$ tgswitch
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x12fea31]

goroutine 1 [running]:
github.com/warrensbox/tgswitch/lib.GetAppList(0x13cf9a8, 0x3e, 0xc0000b3f00, 0x0, 0x141c300, 0xc00007f0b0, 0x2c, 0x1, 0xc00000f070)
        /go/src/github.com/warrensbox/tgswitch/lib/list_versions.go:54 +0x321
main.main()
        /go/src/github.com/warrensbox/tgswitch/main.go:115 +0x3e2

I have successfully installed it from brew install warrensbox/tap/tgswitch.

For now, I am not able to use tgswitch.

Please help :)

fixed #98