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

Running 'make test' command with 1.22.0 go version #1242

Open
Julik24 opened this issue Feb 14, 2024 · 2 comments
Open

Running 'make test' command with 1.22.0 go version #1242

Julik24 opened this issue Feb 14, 2024 · 2 comments

Comments

@Julik24
Copy link

Julik24 commented Feb 14, 2024

Describe the bug
Unable to run tests in argocd-operator project with the newest go version

To Reproduce
Steps to reproduce the behavior:

  1. Install go version go1.22.0 linux/amd64
  2. Clone https://github.com/argoproj-labs/argocd-operator.git repo
  3. Run 'make test' in argocd-operator folder
  4. See error
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=0x9e9f9e]goroutine 162 [running]:
go/types.(*Checker).handleBailout(0xc00078b200, 0xc0013d7d40)
	/usr/local/go/src/go/types/check.go:367 +0x88
panic({0xb95520?, 0x1251700?})
	/usr/local/go/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0xd7f648, 0x1259fe0})
	/usr/local/go/src/go/types/sizes.go:228 +0x31e
go/types.(*Config).sizeof(...)
	/usr/local/go/src/go/types/sizes.go:333
go/types.representableConst.func1({0xd7f648?, 0x1259fe0?})
	/usr/local/go/src/go/types/const.go:76 +0x9e
go/types.representableConst({0xd85a20, 0x1226318}, 0xc00078b200, 0x1259fe0, 0xc0013d3b40)
	/usr/local/go/src/go/types/const.go:106 +0x2c7
go/types.(*Checker).representation(0xc00078b200, 0xc0013cf680, 0x1259fe0)
	/usr/local/go/src/go/types/const.go:256 +0x65
go/types.(*Checker).representable(0xc00078b200, 0xc0013cf680, 0x1259fe0)
	/usr/local/go/src/go/types/const.go:239 +0x26
go/types.(*Checker).shift(0xc00078b200, 0xc0013cf600, 0xc0013cf680, {0xd83768, 0xc001136060}, 0x14)
	/usr/local/go/src/go/types/expr.go:650 +0x1eb
go/types.(*Checker).binary(0xc00078b200, 0xc0013cf600, {0xd83768, 0xc001136060}, {0xd83c78, 0xc0011345c0}, {0xd83c78, 0xc0011345e0}, 0x14, 0x3615e3)
	/usr/local/go/src/go/types/expr.go:796 +0x150
go/types.(*Checker).exprInternal(0xc00078b200, 0x0, 0xc0013cf600, {0xd83768, 0xc001136060}, {0x0, 0x0})
	/usr/local/go/src/go/types/expr.go:1416 +0x206
go/types.(*Checker).rawExpr(0xc00078b200, 0x0, 0xc0013cf600, {0xd83768?, 0xc001136060?}, {0x0?, 0x0?}, 0x0)
	/usr/local/go/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).exprInternal(0xc00078b200, 0x0, 0xc0013cf600, {0xd83618, 0xc001134600}, {0x0, 0x0})
	/usr/local/go/src/go/types/expr.go:1320 +0x178
go/types.(*Checker).rawExpr(0xc00078b200, 0x0, 0xc0013cf600, {0xd83618?, 0xc001134600?}, {0x0?, 0x0?}, 0x0)
	/usr/local/go/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).expr(0xc00078b200, 0x0?, 0xc0013cf600, {0xd83618?, 0xc001134600?})
	/usr/local/go/src/go/types/expr.go:1513 +0x30
go/types.(*Checker).binary(0xc00078b200, 0xc0013cf600, {0xd83768, 0xc001136090}, {0xd83618, 0xc001134600}, {0xd83c78, 0xc001134620}, 0xd, 0x3615e8)
	/usr/local/go/src/go/types/expr.go:783 +0xa5
go/types.(*Checker).exprInternal(0xc00078b200, 0x0, 0xc0013cf600, {0xd83768, 0xc001136090}, {0x0, 0x0})
	/usr/local/go/src/go/types/expr.go:1416 +0x206
go/types.(*Checker).rawExpr(0xc00078b200, 0x0, 0xc0013cf600, {0xd83768?, 0xc001136090?}, {0x0?, 0x0?}, 0x1)
	/usr/local/go/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).use1(0xc00078b200, {0xd83768, 0xc001136090}, 0x0)
	/usr/local/go/src/go/types/call.go:1043 +0x1a5
go/types.(*Checker).useN(...)
	/usr/local/go/src/go/types/call.go:1004
go/types.(*Checker).use(...)
	/usr/local/go/src/go/types/call.go:994
go/types.(*Checker).callExpr(0xc00078b200, 0xc0013cf540, 0xc0011382c0)
	/usr/local/go/src/go/types/call.go:196 +0x1770
go/types.(*Checker).exprInternal(0xc00078b200, 0x0, 0xc0013cf540, {0xd83d38, 0xc0011382c0}, {0x0, 0x0})
	/usr/local/go/src/go/types/expr.go:1374 +0xf8
go/types.(*Checker).rawExpr(0xc00078b200, 0x0, 0xc0013cf540, {0xd83d38?, 0xc0011382c0?}, {0x0?, 0x0?}, 0x0)
	/usr/local/go/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).expr(0xc00078b200, 0xc001568230?, 0xc0013cf540, {0xd83d38?, 0xc0011382c0?})
	/usr/local/go/src/go/types/expr.go:1513 +0x30
go/types.(*Checker).exprInternal(0xc00078b200, 0x0, 0xc0013cf540, {0xd836d8, 0xc001138300}, {0x0, 0x0})
	/usr/local/go/src/go/types/expr.go:1190 +0x1f1f
go/types.(*Checker).rawExpr(0xc00078b200, 0x0, 0xc0013cf540, {0xd836d8?, 0xc001138300?}, {0x0?, 0x0?}, 0x0)
	/usr/local/go/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).expr(0xc00078b200, 0x0?, 0xc0013cf540, {0xd836d8?, 0xc001138300?})
	/usr/local/go/src/go/types/expr.go:1513 +0x30
go/types.(*Checker).varDecl(0xc00078b200, 0xc000fc8000, {0xc0017888c0, 0x1, 0x1}, {0x0, 0x0}, {0xd836d8, 0xc001138300})
	/usr/local/go/src/go/types/decl.go:521 +0x17b
go/types.(*Checker).objDecl(0xc00078b200, {0xd8b058, 0xc000fc8000}, 0x0)
	/usr/local/go/src/go/types/decl.go:194 +0x9e5
go/types.(*Checker).packageObjects(0xc00078b200)
	/usr/local/go/src/go/types/resolver.go:693 +0x4dd
go/types.(*Checker).checkFiles(0xc00078b200, {0xc000976000, 0x7, 0x7})
	/usr/local/go/src/go/types/check.go:408 +0x1a5
go/types.(*Checker).Files(...)
	/usr/local/go/src/go/types/check.go:372
[sigs.k8s.io/controller-tools/pkg/loader.(*loader).typeCheck(0xc000246fc0](http://sigs.k8s.io/controller-tools/pkg/loader.(*loader).typeCheck(0xc000246fc0), 0xc000974000)
	/home/jteslia/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/loader/loader.go:283 +0x36a
[sigs.k8s.io/controller-tools/pkg/loader.(*Package).NeedTypesInfo(0xc000974000)](http://sigs.k8s.io/controller-tools/pkg/loader.(*Package).NeedTypesInfo(0xc000974000))
	/home/jteslia/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/loader/loader.go:96 +0x39
[sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check(0xc000a9ce70](http://sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check(0xc000a9ce70), 0xc000974000)
	/home/jteslia/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/loader/refs.go:263 +0x2b7
[sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check.func1(0x41?)](http://sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check.func1(0x41?))
	/home/jteslia/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/loader/refs.go:257 +0x53
created by [sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check](http://sigs.k8s.io/controller-tools/pkg/loader.(*TypeChecker).check) in goroutine 58
	/home/jteslia/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/loader/refs.go:255 +0x1c5
make: *** [Makefile:79: manifests] Error 2
@gnunn1
Copy link
Contributor

gnunn1 commented Mar 3, 2024

Same issue with make install run, I had to revert to go 1.21 to workaround it.

@svghadi
Copy link
Collaborator

svghadi commented Jul 25, 2024

Looks like the failure occurs due to transitive dependency sigs.k8s.io/[email protected]. It seems that lower version of this dependency is incompatible with go 1.22.
kubernetes-sigs/controller-tools#945 (comment)

Btw, the same happens up to 0.12.1 with Go 1.22. Starting 0.13.0 it works ok.

With recent upgrade of operator-sdk version, this dependency has been updated to sigs.k8s.io/[email protected], so we probably shouldn't be seeing this now. I will run a test later to confirm.

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

No branches or pull requests

3 participants