Skip to content

Update x/tools to fix panic in tests with Go 1.23 #19

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

Merged
merged 2 commits into from
Nov 29, 2024
Merged

Update x/tools to fix panic in tests with Go 1.23 #19

merged 2 commits into from
Nov 29, 2024

Conversation

alexandear
Copy link
Contributor

This PR fixes panic in tests when running with Go 1.23.

Details

?   	github.com/curioswitch/go-reassign	[no test files]
?   	github.com/curioswitch/go-reassign/cmd	[no test files]
?   	github.com/curioswitch/go-reassign/magefiles	[no test files]
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=0x2 addr=0x0 pc=0x1031d96a4]

goroutine 131 [running]:
go/types.(*Checker).handleBailout(0x14000482540, 0x140004b3c08)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/check.go:404 +0x9c
panic({0x1032f2500?, 0x1034d4540?})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/runtime/panic.go:785 +0x124
go/types.(*StdSizes).Sizeof(0x0, {0x103340008, 0x1034d7a80})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/sizes.go:229 +0x314
go/types.(*Config).sizeof(...)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/sizes.go:334
go/types.representableConst.func1({0x103340008?, 0x1034d7a80?})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/const.go:77 +0x90
go/types.representableConst({0x103341768, 0x1034cbd18}, 0x14000482540, 0x1034d7a80, 0x140004b29e8)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/const.go:93 +0x134
go/types.(*Checker).representation(0x14000482540, 0x1400053ec80, 0x1034d7a80)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/const.go:257 +0x68
go/types.(*Checker).implicitTypeAndValue(0x14000482540, 0x1400053ec80, {0x103340008, 0x1034d7a80})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:377 +0x304
go/types.(*Checker).assignment(0x14000482540, 0x1400053ec80, {0x103340008, 0x1034d7a80}, {0x10325585b, 0xe})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/assignments.go:70 +0x3ac
go/types.(*Checker).exprInternal(0x14000482540, 0x0, 0x1400053ec80, {0x103340b68, 0x140004a8300}, {0x103340058, 0x1400063a000})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:1211 +0x1810
go/types.(*Checker).rawExpr(0x14000482540, 0x0, 0x1400053ec80, {0x103340b68?, 0x140004a8300?}, {0x103340058?, 0x1400063a000?}, 0x0)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:981 +0x120
go/types.(*Checker).exprWithHint(0x14000482540, 0x1400053ec80, {0x103340b68, 0x140004a8300}, {0x103340058, 0x1400063a000})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:1599 +0x64
go/types.(*Checker).indexedElts(0x14000482540, {0x140004c8008, 0x24, 0x14000499a70?}, {0x103340058, 0x1400063a000}, 0xffffffffffffffff)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/index.go:453 +0xcc
go/types.(*Checker).exprInternal(0x14000482540, 0x0, 0x1400053ec00, {0x103340b68, 0x140004a90c0}, {0x0, 0x0})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:1283 +0xbbc
go/types.(*Checker).rawExpr(0x14000482540, 0x0, 0x1400053ec00, {0x103340b68?, 0x140004a90c0?}, {0x0?, 0x0?}, 0x0)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:981 +0x120
go/types.(*Checker).expr(0x14000482540, 0x0?, 0x1400053ec00, {0x103340b68?, 0x140004a90c0?})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:1549 +0x38
go/types.(*Checker).varDecl(0x14000482540, 0x14000608180, {0x140006060e8, 0x1, 0x1}, {0x0, 0x0}, {0x103340b68, 0x140004a90c0})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/decl.go:513 +0x140
go/types.(*Checker).objDecl(0x14000482540, {0x103343af8, 0x14000608180}, 0x0)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/decl.go:188 +0x7e0
go/types.(*Checker).packageObjects(0x14000482540)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/resolver.go:714 +0x3f0
go/types.(*Checker).checkFiles(0x14000482540, {0x1400049c000, 0x1, 0x1})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/check.go:459 +0x190
go/types.(*Checker).Files(0x1400018e0e0?, {0x1400049c000?, 0x14000496060?, 0x6?})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/check.go:422 +0x80
golang.org/x/tools/go/packages.(*loader).loadPackage(0x1400018e0e0, 0x1400019d710)
	/Users/Oleksandr_Redko/go/pkg/mod/golang.org/x/tools@v0.3.0/go/packages/packages.go:1037 +0x76c
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
	/Users/Oleksandr_Redko/go/pkg/mod/golang.org/x/tools@v0.3.0/go/packages/packages.go:847 +0x178
sync.(*Once).doSlow(0x0?, 0x0?)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/sync/once.go:76 +0xf8
sync.(*Once).Do(...)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/sync/once.go:67
golang.org/x/tools/go/packages.(*loader).loadRecursive(0x0?, 0x0?)
	/Users/Oleksandr_Redko/go/pkg/mod/golang.org/x/tools@v0.3.0/go/packages/packages.go:835 +0x48
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1(0x0?)
	/Users/Oleksandr_Redko/go/pkg/mod/golang.org/x/tools@v0.3.0/go/packages/packages.go:842 +0x30
created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 8
	/Users/Oleksandr_Redko/go/pkg/mod/golang.org/x/tools@v0.3.0/go/packages/packages.go:841 +0x84
FAIL	github.com/curioswitch/go-reassign/internal/analyzer	0.654s
FAIL

Verified

This commit was signed with the committer’s verified signature.
bhrutledge Brian Rutledge
@chokoswitch
Copy link
Collaborator

Thanks @alexandear - I completely missed the dependabot PR from a while ago that was updating this, will go with this PR instead

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…update-x-tools
@chokoswitch chokoswitch merged commit b34e3f5 into curioswitch:main Nov 29, 2024
6 checks passed
@alexandear alexandear deleted the update-x-tools branch November 29, 2024 08:36
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

Successfully merging this pull request may close these issues.

None yet

2 participants