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

Bug: make manifests fails with Go >1.21 #885

Closed
sharnoff opened this issue Mar 29, 2024 · 0 comments · Fixed by #919
Closed

Bug: make manifests fails with Go >1.21 #885

sharnoff opened this issue Mar 29, 2024 · 0 comments · Fixed by #919
Assignees
Labels
a/internal_devx Area: impacts our team productivity t/bug Issue Type: Bug

Comments

@sharnoff
Copy link
Member

Environment

Local development, with Go 1.22, for example.

$ go version
go version go1.22.1 linux/amd64

Steps to reproduce

  1. Clone the repository
  2. Run make manifests
  3. Profit

Expected result

make manifests should complete successfully

Actual result

It fails with a null pointer deref.

Command output
$ make manifests
mkdir -p /path/to/repo/bin
go: downloading sigs.k8s.io/controller-tools v0.10.0
go: downloading github.com/spf13/cobra v1.4.0
go: downloading github.com/gobuffalo/flect v0.2.5
go: downloading github.com/fatih/color v1.12.0
go: downloading golang.org/x/tools v0.1.12
go: downloading github.com/mattn/go-isatty v0.0.12
go: downloading github.com/mattn/go-colorable v0.1.8
go: downloading golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4
/path/to/repo/bin/controller-gen rbac:roleName=manager-role crd webhook paths="./neonvm/..." \
	output:crd:artifacts:config=neonvm/config/crd/bases \
	output:rbac:artifacts:config=neonvm/config/rbac \
	output:webhook:artifacts:config=neonvm/config/webhook
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=0xa047cf]

goroutine 127 [running]:
go/types.(*Checker).handleBailout(0xc0001b3200, 0xc0013f7d40)
	/usr/lib/go/src/go/types/check.go:367 +0x88
panic({0xbbb960?, 0x129ace0?})
	/usr/lib/go/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0xdb0c18, 0x12a34c0})
	/usr/lib/go/src/go/types/sizes.go:228 +0x30f
go/types.(*Config).sizeof(...)
	/usr/lib/go/src/go/types/sizes.go:333
go/types.representableConst.func1({0xdb0c18?, 0x12a34c0?})
	/usr/lib/go/src/go/types/const.go:76 +0x9e
go/types.representableConst({0xdb6eb8, 0x126f798}, 0xc0001b3200, 0x12a34c0, 0xc0013f3b40)
	/usr/lib/go/src/go/types/const.go:106 +0x2c7
go/types.(*Checker).representation(0xc0001b3200, 0xc0013ee7c0, 0x12a34c0)
	/usr/lib/go/src/go/types/const.go:256 +0x65
go/types.(*Checker).representable(0xc0001b3200, 0xc0013ee7c0, 0x12a34c0)
	/usr/lib/go/src/go/types/const.go:239 +0x26
go/types.(*Checker).shift(0xc0001b3200, 0xc0013ee740, 0xc0013ee7c0, {0xdb4ce8, 0xc000d861b0}, 0x14)
	/usr/lib/go/src/go/types/expr.go:650 +0x1eb
go/types.(*Checker).binary(0xc0001b3200, 0xc0013ee740, {0xdb4ce8, 0xc000d861b0}, {0xdb51f8, 0xc000d8e020}, {0xdb51f8, 0xc000d8e040}, 0x14, 0x11ee08)
	/usr/lib/go/src/go/types/expr.go:796 +0x150
go/types.(*Checker).exprInternal(0xc0001b3200, 0x0, 0xc0013ee740, {0xdb4ce8, 0xc000d861b0}, {0x0, 0x0})
	/usr/lib/go/src/go/types/expr.go:1416 +0x206
go/types.(*Checker).rawExpr(0xc0001b3200, 0x0, 0xc0013ee740, {0xdb4ce8?, 0xc000d861b0?}, {0x0?, 0x0?}, 0x0)
	/usr/lib/go/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).exprInternal(0xc0001b3200, 0x0, 0xc0013ee740, {0xdb4b98, 0xc000d8e060}, {0x0, 0x0})
	/usr/lib/go/src/go/types/expr.go:1320 +0x178
go/types.(*Checker).rawExpr(0xc0001b3200, 0x0, 0xc0013ee740, {0xdb4b98?, 0xc000d8e060?}, {0x0?, 0x0?}, 0x0)
	/usr/lib/go/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).expr(0xc0001b3200, 0x0?, 0xc0013ee740, {0xdb4b98?, 0xc000d8e060?})
	/usr/lib/go/src/go/types/expr.go:1513 +0x30
go/types.(*Checker).binary(0xc0001b3200, 0xc0013ee740, {0xdb4ce8, 0xc000d861e0}, {0xdb4b98, 0xc000d8e060}, {0xdb51f8, 0xc000d8e080}, 0xd, 0x11ee0d)
	/usr/lib/go/src/go/types/expr.go:783 +0xa5
go/types.(*Checker).exprInternal(0xc0001b3200, 0x0, 0xc0013ee740, {0xdb4ce8, 0xc000d861e0}, {0x0, 0x0})
	/usr/lib/go/src/go/types/expr.go:1416 +0x206
go/types.(*Checker).rawExpr(0xc0001b3200, 0x0, 0xc0013ee740, {0xdb4ce8?, 0xc000d861e0?}, {0x0?, 0x0?}, 0x1)
	/usr/lib/go/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).use1(0xc0001b3200, {0xdb4ce8, 0xc000d861e0}, 0x0)
	/usr/lib/go/src/go/types/call.go:1043 +0x1a5
go/types.(*Checker).useN(...)
	/usr/lib/go/src/go/types/call.go:1004
go/types.(*Checker).use(...)
	/usr/lib/go/src/go/types/call.go:994
go/types.(*Checker).callExpr(0xc0001b3200, 0xc0013ee680, 0xc000d88580)
	/usr/lib/go/src/go/types/call.go:196 +0x175e
go/types.(*Checker).exprInternal(0xc0001b3200, 0x0, 0xc0013ee680, {0xdb52b8, 0xc000d88580}, {0x0, 0x0})
	/usr/lib/go/src/go/types/expr.go:1374 +0xf8
go/types.(*Checker).rawExpr(0xc0001b3200, 0x0, 0xc0013ee680, {0xdb52b8?, 0xc000d88580?}, {0x0?, 0x0?}, 0x0)
	/usr/lib/go/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).expr(0xc0001b3200, 0xc00033e0e0?, 0xc0013ee680, {0xdb52b8?, 0xc000d88580?})
	/usr/lib/go/src/go/types/expr.go:1513 +0x30
go/types.(*Checker).exprInternal(0xc0001b3200, 0x0, 0xc0013ee680, {0xdb4c58, 0xc000d885c0}, {0x0, 0x0})
	/usr/lib/go/src/go/types/expr.go:1190 +0x1ea5
go/types.(*Checker).rawExpr(0xc0001b3200, 0x0, 0xc0013ee680, {0xdb4c58?, 0xc000d885c0?}, {0x0?, 0x0?}, 0x0)
	/usr/lib/go/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).expr(0xc0001b3200, 0x0?, 0xc0013ee680, {0xdb4c58?, 0xc000d885c0?})
	/usr/lib/go/src/go/types/expr.go:1513 +0x30
go/types.(*Checker).varDecl(0xc0001b3200, 0xc00082cae0, {0xc0007a2e20, 0x1, 0x1}, {0x0, 0x0}, {0xdb4c58, 0xc000d885c0})
	/usr/lib/go/src/go/types/decl.go:521 +0x17b
go/types.(*Checker).objDecl(0xc0001b3200, {0xdbc7e0, 0xc00082cae0}, 0x0)
	/usr/lib/go/src/go/types/decl.go:194 +0x9e5
go/types.(*Checker).packageObjects(0xc0001b3200)
	/usr/lib/go/src/go/types/resolver.go:693 +0x4dd
go/types.(*Checker).checkFiles(0xc0001b3200, {0xc00070a740, 0x7, 0x7})
	/usr/lib/go/src/go/types/check.go:408 +0x1a5
go/types.(*Checker).Files(...)
	/usr/lib/go/src/go/types/check.go:372
sigs.k8s.io/controller-tools/pkg/loader.(*loader).typeCheck(0xc00037d170, 0xc0008e1460)
	/path/to/go/pkg/mod/sigs.k8s.io/controller-tools@v0.10.0/pkg/loader/loader.go:286 +0x36a
sigs.k8s.io/controller-tools/pkg/loader.(*Package).NeedTypesInfo(0xc0008e1460)
	/path/to/go/pkg/mod/sigs.k8s.io/controller-tools@v0.10.0/pkg/loader/loader.go:99 +0x39
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check(0xc000cfc5d0, 0xc0008e1460)
	/path/to/go/pkg/mod/sigs.k8s.io/controller-tools@v0.10.0/pkg/loader/refs.go:268 +0x2b7
sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check.func1(0x47?)
	/path/to/go/pkg/mod/sigs.k8s.io/controller-tools@v0.10.0/pkg/loader/refs.go:262 +0x53
created by sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check in goroutine 1
	/path/to/go/pkg/mod/sigs.k8s.io/controller-tools@v0.10.0/pkg/loader/refs.go:260 +0x1c5
make: *** [Makefile:93: manifests] Error 2

Other logs, links

@sharnoff sharnoff added a/internal_devx Area: impacts our team productivity t/bug Issue Type: Bug labels Mar 29, 2024
sharnoff added a commit that referenced this issue Apr 23, 2024
We currently see issues with Go >1.21 and our current controller-gen
version, so a reasonable workaround is to always run with Go 1.21
instead of using whatever the system happens to have install.

Easiest way to do that is by doing the manifest generation inside a
container, and `make generate` already serves that purpose, so this
commit changes the generation script to *also* generate the manifests.

This commit also removes all prior occurrences of `make manifests`.

Fixes #885.
@sharnoff sharnoff self-assigned this Apr 23, 2024
sharnoff added a commit that referenced this issue Apr 29, 2024
We currently see issues with Go >1.21 and our current controller-gen
version, so a reasonable workaround is to always run with Go 1.21
instead of using whatever the system happens to have installed.

Easiest way to do that is by doing the manifest generation inside a
container, and `make generate` already serves that purpose, so this
commit changes the generation script to *also* generate the manifests.

This commit also removes all prior occurrences of `make manifests`.

Fixes #885.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a/internal_devx Area: impacts our team productivity t/bug Issue Type: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant