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

Panics when building w/ Go 1.22.x #1521

Open
mamachanko opened this issue Apr 8, 2024 · 1 comment
Open

Panics when building w/ Go 1.22.x #1521

mamachanko opened this issue Apr 8, 2024 · 1 comment
Assignees
Labels
bug This issue describes a defect or unexpected behavior carvel-accepted This issue should be considered for future work and that the triage process has been completed priority/important-soon Must be staffed and worked on currently or soon.

Comments

@mamachanko
Copy link
Contributor

What steps did you take:

  1. Checkout kapp-controller
  2. Build with Golang 1.22

What happened:

❯ go version
go version go1.22.2 darwin/amd64

❯ git rev-parse @
6f2515eb308e4238b24c8a78fe201dc06a566cd0

❯ ./hack/build.sh
+ export CGO_ENABLED=0
+ CGO_ENABLED=0
+ go mod vendor
+ go mod tidy
+ go fmt ./cmd/... ./pkg/...
+ go build -trimpath -mod=vendor -o controller ./cmd/controller/...
+ ls -la ./controller
-rwxr-xr-x@ 1 *****  *****  ***** ***** ./controller
+ ./hack/gen-crds.sh
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xaa2ee4f]

goroutine 103 [running]:
go/types.(*Checker).handleBailout(0xc00077e800, 0xc001475d40)
        /usr/local/Cellar/go/1.22.2/libexec/src/go/types/check.go:367 +0x88
panic({0xad49760?, 0xb2fd820?})
        /usr/local/Cellar/go/1.22.2/libexec/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0xae14070, 0xb305f80})
        /usr/local/Cellar/go/1.22.2/libexec/src/go/types/sizes.go:228 +0x30f
go/types.(*Config).sizeof(...)
        /usr/local/Cellar/go/1.22.2/libexec/src/go/types/sizes.go:333
go/types.representableConst.func1({0xae14070?, 0xb305f80?})
        /usr/local/Cellar/go/1.22.2/libexec/src/go/types/const.go:76 +0x9e
go/types.representableConst({0xae1a2f0, 0xb2d1020}, 0xc00077e800, 0xb305f80, 0xc0014754b0)
        /usr/local/Cellar/go/1.22.2/libexec/src/go/types/const.go:92 +0x192
go/types.(*Checker).representation(0xc00077e800, 0xc001453480, 0xb305f80)
        /usr/local/Cellar/go/1.22.2/libexec/src/go/types/const.go:256 +0x65
go/types.(*Checker).implicitTypeAndValue(0xc00077e800, 0xc001453480, {0xae14098, 0xc0001daee0})
        /usr/local/Cellar/go/1.22.2/libexec/src/go/types/expr.go:375 +0x2d7
go/types.(*Checker).assignment(0xc00077e800, 0xc001453480, {0xae14098, 0xc0001daee0}, {0xab89f74, 0x14})
        /usr/local/Cellar/go/1.22.2/libexec/src/go/types/assignments.go:52 +0x2e5
go/types.(*Checker).initConst(0xc00077e800, 0xc00141d080, 0xc001453480)
        /usr/local/Cellar/go/1.22.2/libexec/src/go/types/assignments.go:126 +0x2c5
go/types.(*Checker).constDecl(0xc00077e800, 0xc00141d080, {0xae16c18, 0xc001a1a1c0}, {0xae16c18, 0xc001a1a1e0}, 0x0)
        /usr/local/Cellar/go/1.22.2/libexec/src/go/types/decl.go:490 +0x311
go/types.(*Checker).objDecl(0xc00077e800, {0xae1f380, 0xc00141d080}, 0x0)
        /usr/local/Cellar/go/1.22.2/libexec/src/go/types/decl.go:191 +0xa49
go/types.(*Checker).packageObjects(0xc00077e800)
        /usr/local/Cellar/go/1.22.2/libexec/src/go/types/resolver.go:693 +0x4dd
go/types.(*Checker).checkFiles(0xc00077e800, {0xc00198a000, 0x5, 0x5})
        /usr/local/Cellar/go/1.22.2/libexec/src/go/types/check.go:408 +0x1a5
go/types.(*Checker).Files(...)
        /usr/local/Cellar/go/1.22.2/libexec/src/go/types/check.go:372
sigs.k8s.io/controller-tools/pkg/loader.(*loader).typeCheck(0xc0002031a0, 0xc0014624c0)
        /Users/*****/workspace/carvel/kapp-controller/vendor/sigs.k8s.io/controller-tools/pkg/loader/loader.go:283 +0x36a
sigs.k8s.io/controller-tools/pkg/loader.(*Package).NeedTypesInfo(0xc0014624c0)
        /Users/*****/workspace/carvel/kapp-controller/vendor/sigs.k8s.io/controller-tools/pkg/loader/loader.go:96 +0x39
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check(0xc0009a9680, 0xc0014624c0)
        /Users/*****/workspace/carvel/kapp-controller/vendor/sigs.k8s.io/controller-tools/pkg/loader/refs.go:263 +0x2b7
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check.func1(0x65?)
        /Users/*****/workspace/carvel/kapp-controller/vendor/sigs.k8s.io/controller-tools/pkg/loader/refs.go:257 +0x53
created by sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check in goroutine 65
        /Users/*****/workspace/carvel/kapp-controller/vendor/sigs.k8s.io/controller-tools/pkg/loader/refs.go:255 +0x1c5
exit status 2

What did you expect:

kapp-controller can be built with any Golang >= 1.21

Anything else you would like to add:

Environment:

  • macOS
  • Golang 1.22.2

Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

@mamachanko mamachanko added bug This issue describes a defect or unexpected behavior carvel-triage This issue has not yet been reviewed for validity labels Apr 8, 2024
@praveenrewar
Copy link
Member

Thank you for reporting the issue @mamachanko! There is a fix available for this in #1441, we need to bump to latest version of client-go which is something we have been holding off for a while (due to some warnings on older k8s version). Now it seems that we will have to bump to latest version of client-go if we want to move to go 1.22.x.
cc @renuy @rohitagg2020

@praveenrewar praveenrewar added carvel-accepted This issue should be considered for future work and that the triage process has been completed and removed carvel-triage This issue has not yet been reviewed for validity labels Apr 8, 2024
@renuy renuy added the priority/important-soon Must be staffed and worked on currently or soon. label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a defect or unexpected behavior carvel-accepted This issue should be considered for future work and that the triage process has been completed priority/important-soon Must be staffed and worked on currently or soon.
Projects
Status: Prioritized Backlog
Development

No branches or pull requests

4 participants