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

fatih/errwrap linter failing on Go 1.22rc2 with runtime error: invalid memory address or nil pointer dereference error #1331

Closed
atc0005 opened this issue Feb 6, 2024 · 1 comment · Fixed by #1332
Assignees
Labels
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Feb 6, 2024

Overview

The errwrap linter is failing to execute in Go 1.22rc2 unstable images.

Output from a recent CI run:

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=0x5b537e]

goroutine 36 [running]:
go/types.(*Checker).handleBailout(0xc0000f5000, 0xc0001d7bd0)
	/usr/local/go/src/go/types/check.go:367 +0x88
panic({0x7167c0?, 0x99ea30?})
	/usr/local/go/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0x7e4328, 0x9a26e0})
	/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({0x7e4328?, 0x9a26e0?})
	/usr/local/go/src/go/types/const.go:76 +0x9e
go/types.representableConst({0x7e6068, 0x9973a8}, 0xc0000f5000, 0x9a26e0, 0xc0001d5c00)
	/usr/local/go/src/go/types/const.go:92 +0x192
go/types.(*Checker).representation(0xc0000f5000, 0xc00038aec0, 0x9a26e0)
	/usr/local/go/src/go/types/const.go:256 +0x65
go/types.(*Checker).implicitTypeAndValue(0xc0000f5000, 0xc00038aec0, {0x7e4328, 0x9a26e0})
	/usr/local/go/src/go/types/expr.go:375 +0x30d
go/types.(*Checker).convertUntyped(0xc0000f5000, 0xc00038aec0, {0x7e4328, 0x9a26e0})
	/usr/local/go/src/go/types/const.go:289 +0x3f
go/types.(*Checker).matchTypes(0xc0000f5000, 0xc00038ae80, 0xc00038aec0)
	/usr/local/go/src/go/types/expr.go:926 +0x79
go/types.(*Checker).binary(0xc0000f5000, 0xc00038ae80, {0x7e55f0, 0xc00009ef90}, {0x7e5200, 0xc00038a200}, {0x7e5290, 0xc000380960}, 0xd, 0x60032e)
	/usr/local/go/src/go/types/expr.go:800 +0x166
go/types.(*Checker).exprInternal(0xc0000f5000, 0x0, 0xc00038ae80, {0x7e55f0, 0xc00009ef90}, {0x0, 0x0})
	/usr/local/go/src/go/types/expr.go:1416 +0x206
go/types.(*Checker).rawExpr(0xc0000f5000, 0x0, 0xc00038ae80, {0x7e55f0?, 0xc00009ef90?}, {0x0?, 0x0?}, 0x0)
	/usr/local/go/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).expr(0xc0000f5000, 0x0?, 0xc00038ae80, {0x7e55f0?, 0xc00009ef90?})
	/usr/local/go/src/go/types/expr.go:1513 +0x30
go/types.(*Checker).initVars(0xc0000f5000, {0xc000184d80, 0x1, 0x0?}, {0xc000026070, 0x6002ae?, 0x1?}, {0x0, 0x0})
	/usr/local/go/src/go/types/assignments.go:381 +0x60b
go/types.(*Checker).shortVarDecl(0xc0000f5000, {0x7e32a0, 0xc0003a0150}, {0xc000026050, 0x1, 0xc0000e0d38?}, {0xc000026070, 0x1, 0x1})
	/usr/local/go/src/go/types/assignments.go:556 +0x8f0
go/types.(*Checker).stmt(0xc0000f5000, 0x0, {0x7e57d0, 0xc00038a240})
	/usr/local/go/src/go/types/stmt.go:473 +0x15ff
go/types.(*Checker).stmtList(0xc0000f5000, 0x0, {0xc000112600?, 0x0?, 0x0?})
	/usr/local/go/src/go/types/stmt.go:121 +0x85
go/types.(*Checker).funcBody(0xc0000f5000, 0x1?, {0xc0003c7564?, 0x0?}, 0xc00038ac00, 0xc00009f3e0, {0x0?, 0x0?})
	/usr/local/go/src/go/types/stmt.go:41 +0x331
go/types.(*Checker).funcDecl.func1()
	/usr/local/go/src/go/types/decl.go:852 +0x3a
go/types.(*Checker).processDelayed(0xc0000f5000, 0x0)
	/usr/local/go/src/go/types/check.go:467 +0x162
go/types.(*Checker).checkFiles(0xc0000f5000, {0xc0003cbeb0, 0x2, 0x2})
	/usr/local/go/src/go/types/check.go:411 +0x1cc
go/types.(*Checker).Files(...)
	/usr/local/go/src/go/types/check.go:372
golang.org/x/tools/go/packages.(*loader).loadPackage(0xc000116000, 0xc000191230)
	/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:1052 +0xa72
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
	/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:851 +0x1a9
sync.(*Once).doSlow(0xc00003ef98?, 0x405ff7?)
	/usr/local/go/src/sync/once.go:74 +0xc2
sync.(*Once).Do(...)
	/usr/local/go/src/sync/once.go:65
golang.org/x/tools/go/packages.(*loader).loadRecursive(0x65ff3e?, 0xc00003efd0?)
	/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:839 +0x4a
golang.org/x/tools/go/packages.(*loader).refine.func2(0x0?)
	/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:774 +0x26
created by golang.org/x/tools/go/packages.(*loader).refine in goroutine 1
	/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:773 +0xccf

The linter appears to still execute properly from earlier Go images.

References

@atc0005 atc0005 added this to the Next Release milestone Feb 6, 2024
@atc0005 atc0005 self-assigned this Feb 6, 2024
atc0005 added a commit that referenced this issue Feb 6, 2024
Switch from upstream project to temporary fork until the
dependencies for the project are updated to work with
newer Go versions.

refs GH-1331
atc0005 added a commit that referenced this issue Feb 6, 2024
Switch from upstream project to temporary fork until the
dependencies for the project are updated to work with
newer Go versions.

refs GH-1331
atc0005 added a commit that referenced this issue Feb 6, 2024
Switch from upstream project to temporary fork until the
dependencies for the project are updated to work with
newer Go versions.

refs GH-1331
@atc0005
Copy link
Owner Author

atc0005 commented Feb 6, 2024

Submitted upstream PR:

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

Successfully merging a pull request may close this issue.

1 participant