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

version 1.1.0: Segmentation fault panic #125

Closed
gregorypa opened this issue Apr 11, 2022 · 5 comments · Fixed by #129
Closed

version 1.1.0: Segmentation fault panic #125

gregorypa opened this issue Apr 11, 2022 · 5 comments · Fixed by #129

Comments

@gregorypa
Copy link

go-licenses check main.go
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x92f859]

goroutine 1 [running]:
github.com/google/go-licenses/licenses.Libraries.func1(0xc009f34140)
/home/ubuntu/work/pkg/mod/github.com/google/go-licenses@v1.1.0/licenses/library.go:100 +0x259
golang.org/x/tools/go/packages.Visit.func1(0xc009f34140)
/home/ubuntu/work/pkg/mod/golang.org/x/tools@v0.1.10/go/packages/visit.go:26 +0xaa
golang.org/x/tools/go/packages.Visit({0xc003ea5b50, 0x1, 0x1?}, 0xc009d1b850, 0x0)
/home/ubuntu/work/pkg/mod/golang.org/x/tools@v0.1.10/go/packages/visit.go:43 +0x10e
github.com/google/go-licenses/licenses.Libraries({0x134b2a8?, 0xc00011c000?}, {0x1344960, 0xc003ea55a8}, {0xc0002b0ce0?, 0xc00035fd68?, 0xc00035fd90?})
/home/ubuntu/work/pkg/mod/github.com/google/go-licenses@v1.1.0/licenses/library.go:76 +0x22c
main.checkMain(0x16d44e0?, {0xc0002b0ce0, 0x1, 0x1})
/home/ubuntu/work/pkg/mod/github.com/google/go-licenses@v1.1.0/check.go:47 +0x8e
github.com/spf13/cobra.(*Command).execute(0x16d44e0, {0xc0002b0cc0, 0x1, 0x1})
/home/ubuntu/work/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:856 +0x67c
github.com/spf13/cobra.(*Command).ExecuteC(0x16d4260)
/home/ubuntu/work/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
/home/ubuntu/work/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:902
main.main()
/home/ubuntu/work/pkg/mod/github.com/google/go-licenses@v1.1.0/main.go:72 +0x85

egegunes added a commit to percona/percona-server-mongodb-operator that referenced this issue Apr 11, 2022
A few hours ago v1.1.0 released and now it breaks our builds.
See: google/go-licenses#125
hors added a commit to percona/percona-server-mongodb-operator that referenced this issue Apr 11, 2022
A few hours ago v1.1.0 released and now it breaks our builds.
See: google/go-licenses#125

Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
@Bobgy
Copy link
Collaborator

Bobgy commented Apr 11, 2022

Thank you for the report!

I guess I know the root cause

Does it work with this?

go-licenses check .

@Bobgy
Copy link
Collaborator

Bobgy commented Apr 12, 2022

Hmm, my guess was wrong. Can you share more about your project setup?

Are you using GOPATH or go modules?

@Bobgy
Copy link
Collaborator

Bobgy commented Apr 12, 2022

I think I fixed it, but the error means that you might not be using go modules yet.
Can you confirm?

You can try installing go-licenses from master by go install github.com/google/go-licenses@master.

@Bobgy
Copy link
Collaborator

Bobgy commented Apr 12, 2022

Released v1.1.1 with the fix: https://github.com/google/go-licenses/releases/tag/v1.1.1.

@gregorypa
Copy link
Author

fixed. thanks

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

Successfully merging a pull request may close this issue.

2 participants