Skip to content

bump golang.org/x/tools to v0.13.0 to fix panic in tests#38

Merged
ryanrolds merged 1 commit intoryanrolds:mainfrom
alexandear-org:fix/panic-in-tests
May 19, 2025
Merged

bump golang.org/x/tools to v0.13.0 to fix panic in tests#38
ryanrolds merged 1 commit intoryanrolds:mainfrom
alexandear-org:fix/panic-in-tests

Conversation

@alexandear
Copy link
Copy Markdown
Contributor

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

Details

$ go test ./...
?   	github.com/ryanrolds/sqlclosecheck	[no test files]
?   	github.com/ryanrolds/sqlclosecheck/tools	[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=0x102efb3a4]

goroutine 172 [running]:
go/types.(*Checker).handleBailout(0x14000493880, 0x1400013bbb8)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/check.go:404 +0x9c
panic({0x10305eac0?, 0x10327c6e0?})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/runtime/panic.go:785 +0x124
go/types.(*StdSizes).Sizeof(0x0, {0x1030b62b8, 0x10327ff40})
	/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({0x1030b62b8?, 0x10327ff40?})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/const.go:77 +0x90
go/types.representableConst({0x1030b8368, 0x103273df8}, 0x14000493880, 0x10327ff40, 0x1400013a8f8)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/const.go:107 +0x2ac
go/types.(*Checker).representation(0x14000493880, 0x140004fb140, 0x10327ff40)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/const.go:257 +0x68
go/types.(*Checker).representable(0x14000493880, 0x140004fb140, 0x10327ff40)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/const.go:240 +0x28
go/types.(*Checker).shift(0x14000493880, 0x140004fb0c0, 0x140004fb140, {0x1030b74d0, 0x140000a6120}, 0x14)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:652 +0x1d4
go/types.(*Checker).binary(0x14000493880, 0x140004fb0c0, {0x1030b74d0, 0x140000a6120}, {0x1030b7380, 0x14000092d60}, {0x1030b7380, 0x14000092d80}, 0x14, 0x3a438)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:798 +0x100
go/types.(*Checker).exprInternal(0x14000493880, 0x0, 0x140004fb0c0, {0x1030b74d0, 0x140000a6120}, {0x0, 0x0})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:1452 +0x1d4
go/types.(*Checker).rawExpr(0x14000493880, 0x0, 0x140004fb0c0, {0x1030b74d0?, 0x140000a6120?}, {0x0?, 0x0?}, 0x0)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:981 +0x120
go/types.(*Checker).expr(0x14000493880, 0x102eef9c4?, 0x140004fb0c0, {0x1030b74d0?, 0x140000a6120?})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:1549 +0x38
go/types.(*Checker).binary(0x14000493880, 0x140004fb0c0, {0x1030b74d0, 0x140000a6150}, {0x1030b74d0, 0x140000a6120}, {0x1030b7380, 0x14000092da0}, 0xd, 0x3a43c)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:785 +0x70
go/types.(*Checker).exprInternal(0x14000493880, 0x0, 0x140004fb0c0, {0x1030b74d0, 0x140000a6150}, {0x0, 0x0})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:1452 +0x1d4
go/types.(*Checker).rawExpr(0x14000493880, 0x0, 0x140004fb0c0, {0x1030b74d0?, 0x140000a6150?}, {0x0?, 0x0?}, 0x0)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:981 +0x120
go/types.(*Checker).expr(0x14000493880, 0x102ecaba8?, 0x140004fb0c0, {0x1030b74d0?, 0x140000a6150?})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:1549 +0x38
go/types.(*Checker).constDecl(0x14000493880, 0x140001cb440, {0x0, 0x0}, {0x1030b74d0, 0x140000a6150}, 0x0)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/decl.go:480 +0x228
go/types.(*Checker).objDecl(0x14000493880, {0x1030bbe38, 0x140001cb440}, 0x0)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/decl.go:185 +0x840
go/types.(*Checker).packageObjects(0x14000493880)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/resolver.go:714 +0x3f0
go/types.(*Checker).checkFiles(0x14000493880, {0x14000290008, 0x1, 0x1})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/check.go:459 +0x190
go/types.(*Checker).Files(0x140002c8000?, {0x14000290008?, 0x140001ca060?, 0x6?})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/check.go:422 +0x80
golang.org/x/tools/go/packages.(*loader).loadPackage(0x140002c8000, 0x140001a1e00)
	/Users/Oleksandr_Redko/src/github.com/ryanrolds/sqlclosecheck/vendor/golang.org/x/tools/go/packages/packages.go:1058 +0x8b4
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
	/Users/Oleksandr_Redko/src/github.com/ryanrolds/sqlclosecheck/vendor/golang.org/x/tools/go/packages/packages.go:854 +0x178
sync.(*Once).doSlow(0x102d14db0?, 0x140003de150?)
	/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?, 0x102d86ef4?)
	/Users/Oleksandr_Redko/src/github.com/ryanrolds/sqlclosecheck/vendor/golang.org/x/tools/go/packages/packages.go:842 +0x48
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1(0x0?)
	/Users/Oleksandr_Redko/src/github.com/ryanrolds/sqlclosecheck/vendor/golang.org/x/tools/go/packages/packages.go:849 +0x30
created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 167
	/Users/Oleksandr_Redko/src/github.com/ryanrolds/sqlclosecheck/vendor/golang.org/x/tools/go/packages/packages.go:848 +0x84
FAIL	github.com/ryanrolds/sqlclosecheck/pkg/analyzer	0.796s
FAIL

@ryanrolds ryanrolds merged commit 67263a3 into ryanrolds:main May 19, 2025
@alexandear alexandear deleted the fix/panic-in-tests branch May 19, 2025 08:21
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.

2 participants