Skip to content
Navigation Menu
vektra
/
mockery
Code
Issues 43
Pull requests 4
Discussions
Actions
Projects
Wiki
Security
Insights
mockery built with go 1.22~rc2 fails #752
Closed
1 of 5 tasks
darix opened this issue Feb 4, 2024 · 6 comments · Fixed by #753
Comments
@darix
darix commented Feb 4, 2024
Description
- set -e
- ARCHIVE=resticprofile-0.24.0.tar.gz
- DIRNAME=resticprofile-0.24.0
- '[' -d resticprofile-0.24.0 ']'
- tar xf resticprofile-0.24.0.tar.gz
- cd resticprofile-0.24.0
- mockery --config .mockery.yaml
04 Feb 24 00:39 CET INF Starting mockery dry-run=false version=2.40.1
04 Feb 24 00:39 CET INF Using config: .mockery.yaml dry-run=false version=2.40.1
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=0x5575a29f8fde]
goroutine 51 [running]:
go/types.(*Checker).handleBailout(0xc0000ea600, 0xc000cd3bd0)
/usr/lib64/go/1.22/src/go/types/check.go:367 +0x88
panic({0x5575a2d58cc0?, 0x5575a30ef3c0?})
/usr/lib64/go/1.22/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0x5575a2dd2dc8, 0x5575a30f4300})
/usr/lib64/go/1.22/src/go/types/sizes.go:228 +0x31e
go/types.(*Config).sizeof(...)
/usr/lib64/go/1.22/src/go/types/sizes.go:333
go/types.representableConst.func1({0x5575a2dd2dc8?, 0x5575a30f4300?})
/usr/lib64/go/1.22/src/go/types/const.go:76 +0x9e
go/types.representableConst({0x5575a2dd56c8, 0x5575a30cbf98}, 0xc0000ea600, 0x5575a30f4300, 0xc000cd0738)
/usr/lib64/go/1.22/src/go/types/const.go:92 +0x192
go/types.(*Checker).representation(0xc0000ea600, 0xc000c97980, 0x5575a30f4300)
/usr/lib64/go/1.22/src/go/types/const.go:256 +0x65
go/types.(*Checker).implicitTypeAndValue(0xc0000ea600, 0xc000c97980, {0x5575a2dd2dc8, 0x5575a30f4300})
/usr/lib64/go/1.22/src/go/types/expr.go:375 +0x30d
go/types.(*Checker).convertUntyped(0xc0000ea600, 0xc000c97980, {0x5575a2dd2dc8, 0x5575a30f4300})
/usr/lib64/go/1.22/src/go/types/const.go:289 +0x3f
go/types.(*Checker).matchTypes(0xc0000ea600, 0xc000c97940, 0xc000c97980)
/usr/lib64/go/1.22/src/go/types/expr.go:926 +0x79
go/types.(*Checker).binary(0xc0000ea600, 0xc000c97940, {0x5575a2dd49f8, 0xc0006608d0}, {0x5575a2dd4fc8, 0xc000c96400}, {0x5575a2dd4998, 0xc000122630}, 0x27, 0x1590700)
/usr/lib64/go/1.22/src/go/types/expr.go:800 +0x166
go/types.(*Checker).exprInternal(0xc0000ea600, 0x0, 0xc000c97940, {0x5575a2dd49f8, 0xc0006608d0}, {0x0, 0x0})
/usr/lib64/go/1.22/src/go/types/expr.go:1416 +0x206
go/types.(*Checker).rawExpr(0xc0000ea600, 0x0, 0xc000c97940, {0x5575a2dd49f8?, 0xc0006608d0?}, {0x0?, 0x0?}, 0x0)
/usr/lib64/go/1.22/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).expr(0xc0000ea600, 0x5575a30f42e0?, 0xc000c97940, {0x5575a2dd49f8?, 0xc0006608d0?})
/usr/lib64/go/1.22/src/go/types/expr.go:1513 +0x30
go/types.(*Checker).initVars(0xc0000ea600, {0xc000d2e660, 0x1, 0x6?}, {0xc000c94310, 0x5575a30f45e0?, 0xc000ca1f80?}, {0x5575a2dd4c98, 0xc0000a06e0})
/usr/lib64/go/1.22/src/go/types/assignments.go:381 +0x60b
go/types.(*Checker).stmt(0xc0000ea600, 0x0, {0x5575a2dd4c98, 0xc0000a06e0})
/usr/lib64/go/1.22/src/go/types/stmt.go:524 +0x1fc5
go/types.(*Checker).stmtList(0xc0000ea600, 0x0, {0xc000c94320?, 0x5575a2ad6c96?, 0x5?})
/usr/lib64/go/1.22/src/go/types/stmt.go:121 +0x85
go/types.(*Checker).stmt(0xc0000ea600, 0x0, {0x5575a2dd4d28, 0xc000660930})
/usr/lib64/go/1.22/src/go/types/stmt.go:562 +0x20f2
go/types.(*Checker).stmt(0xc0000ea600, 0x0, {0x5575a2dd4d58, 0xc000c96440})
/usr/lib64/go/1.22/src/go/types/stmt.go:574 +0x3017
go/types.(*Checker).stmtList(0xc0000ea600, 0x0, {0xc0000bc300?, 0x0?, 0xc000191f10?})
/usr/lib64/go/1.22/src/go/types/stmt.go:121 +0x85
go/types.(*Checker).funcBody(0xc0000ea600, 0x5575a2dd2dc8?, {0xc00049a690?, 0x5575a30f42e0?}, 0xc000c973c0, 0xc0006609f0, {0x0?, 0x0?})
/usr/lib64/go/1.22/src/go/types/stmt.go:41 +0x331
go/types.(*Checker).funcDecl.func1()
/usr/lib64/go/1.22/src/go/types/decl.go:852 +0x3a
go/types.(*Checker).processDelayed(0xc0000ea600, 0x0)
/usr/lib64/go/1.22/src/go/types/check.go:467 +0x162
go/types.(*Checker).checkFiles(0xc0000ea600, {0xc000532d80, 0x4, 0x4})
/usr/lib64/go/1.22/src/go/types/check.go:411 +0x1cc
go/types.(*Checker).Files(...)
/usr/lib64/go/1.22/src/go/types/check.go:372
golang.org/x/tools/go/packages.(*loader).loadPackage(0xc00013e2a0, 0xc000311260)
/home/abuild/rpmbuild/BUILD/mockery-2.40.1/vendor/golang.org/x/tools/go/packages/packages.go:1052 +0xa72
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
/home/abuild/rpmbuild/BUILD/mockery-2.40.1/vendor/golang.org/x/tools/go/packages/packages.go:851 +0x1a9
sync.(*Once).doSlow(0x0?, 0x0?)
/usr/lib64/go/1.22/src/sync/once.go:74 +0xc2
sync.(*Once).Do(...)
/usr/lib64/go/1.22/src/sync/once.go:65
golang.org/x/tools/go/packages.(*loader).loadRecursive(0x0?, 0x0?)
/home/abuild/rpmbuild/BUILD/mockery-2.40.1/vendor/golang.org/x/tools/go/packages/packages.go:839 +0x4a
golang.org/x/tools/go/packages.(*loader).refine.func2(0x0?)
/home/abuild/rpmbuild/BUILD/mockery-2.40.1/vendor/golang.org/x/tools/go/packages/packages.go:774 +0x26
created by golang.org/x/tools/go/packages.(*loader).refine in goroutine 1
/home/abuild/rpmbuild/BUILD/mockery-2.40.1/vendor/golang.org/x/tools/go/packages/packages.go:773 +0xccf
Mockery Version
2.40.1
Golang Version
1.22rc2 works with 1.21
Installation Method
Binary Distribution
Docker
brew
go install
Other: [specify]
Steps to Reproduce
build with go1.22
Expected Behavior
not crashing
Actual Behavior
crashing
@alfa-alex
alfa-alex commented Feb 6, 2024
I can reproduce this. ✔️ Since this implies non-backwards-compatible behavior of the Go compiler, isn't this rather an issue for the Go project?
@darix
Author
darix commented Feb 6, 2024
I just wanted to make the project aware that there is an issue.
@peczenyj
peczenyj commented Feb 7, 2024
This issue is a blocker for me, I can't move to go 1.22 if the mockery panics and I understand it can be an issue that may be fixed in go 1.22.1 but someone must open an issue on google side
@rst7123 rst7123 mentioned this issue Feb 7, 2024
chore(dep): update go to 1.22.0 i-love-flamingo/flamingo#379
Merged
@viktorasm viktorasm mentioned this issue Feb 8, 2024
upgrade golang.org/x/tools to fix a panic in go 1.22 #753
Merged
23 tasks
@viktorasm
Contributor
viktorasm commented Feb 8, 2024
Posted a fix.
It's a bit of a blocker for us, we're using mockery without installing it in CI, via go run, so it gets coupled with the compiler version that CI uses. It's a convenient way for us to pin mockery version across dev machines and CI without relying on dockerized execution.
//go:generate go run github.com/vektra/mockery/v2@v2.40.1
@ajorgensen
ajorgensen commented Feb 8, 2024
I can confirm that @viktorasm fix worked for me
@LandonTClipp LandonTClipp closed this as completed in #753 Feb 8, 2024
@wk989898 wk989898 mentioned this issue Apr 22, 2024
unit_test: go generate command trigger invalid memory address or nil pointer dereference pingcap/tiflow#10938
Closed
@mattavos
mattavos commented Apr 30, 2024
Fixed in mockery v2@2.40.2 (https://github.com/vektra/mockery/releases/tag/v2.40.2) specifically f513d5d
@tobiasgiese tobiasgiese mentioned this issue Jul 15, 2024
fix: bump mockery to fix nil pointer Mellanox/network-operator#992
Merged
adrianchiris added a commit to Mellanox/network-operator that referenced this issue Jul 16, 2024
@adrianchiris
fix: bump mockery to fix nil pointer (#992)
a94039d
blakepettersson added a commit to blakepettersson/argo-workflows that referenced this issue Jul 31, 2024
@blakepettersson
fix: no spaces in archived-workflows
321cab9
@blakepettersson blakepettersson mentioned this issue Jul 31, 2024
fix(swagger): no spaces in archived-workflows. Fixes #10609 argoproj/argo-workflows#13417
Merged
@WantBeASleep
Add a comment
Comment
Add your comment here...
Remember, contributions to this repository should follow its contributing guidelines and code of conduct.
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development
Successfully merging a pull request may close this issue.
upgrade golang.org/x/tools to fix a panic in go 1.22
viktorasm/mockery
You’re not receiving notifications from this thread.
6 participants
@peczenyj
@darix
@ajorgensen
@viktorasm
@alfa-alex
@mattavos
Footer
© 2024 GitHub, Inc.
Footer navigation
Terms
Privacy
Security
Status
Docs
Contact
tobiasgiese mentioned this issue fix: bump mockery to fix nil pointer Mellanox/network-operator#992 Merged adrianchiris added a commit to Mellanox/network-operator that referenced this issue fix: bump mockery to fix nil pointer (#992) … Verified a94039d blakepettersson added a commit to blakepettersson/argo-workflows that referenced this issue fix: no spaces in archived-workflows … 321cab9 blakepettersson mentioned this issue fix(swagger): no spaces in archived-workflows. Fixes #10609 argoproj/argo-workflows#13417 Merged
Это issue с гитхаба библы mockery объясни мне его смысл