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

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

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

alexandear
Copy link
Contributor

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

golang.org/x/tools requires go 1.18 in go.mod.

Details

❯ go version
go version go1.23.3 darwin/arm64
❯ go test ./...
?       github.com/ashanbrown/makezero  [no test files]
?       github.com/ashanbrown/makezero/examples [no test files]
ok      github.com/ashanbrown/makezero/makezero (cached)
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=0x1031ed6c4]

goroutine 111 [running]:
go/types.(*Checker).handleBailout(0x140001acfc0, 0x14000151bb8)
        /opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/check.go:404 +0x9c
panic({0x103303820?, 0x1034f0620?})
        /opt/homebrew/Cellar/go/1.23.3/libexec/src/runtime/panic.go:785 +0x124
go/types.(*StdSizes).Sizeof(0x0, {0x103352de8, 0x1034f3ce0})
        /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({0x103352de8?, 0x1034f3ce0?})
        /opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/const.go:77 +0x90
go/types.representableConst({0x103354448, 0x1034e7d40}, 0x140001acfc0, 0x1034f3ce0, 0x140001509d8)
        /opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/const.go:93 +0x134
go/types.(*Checker).representation(0x140001acfc0, 0x14000252cc0, 0x1034f3ce0)
        /opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/const.go:257 +0x68
go/types.(*Checker).implicitTypeAndValue(0x140001acfc0, 0x14000252cc0, {0x103352de8, 0x1034f3ce0})
        /opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:377 +0x304
go/types.(*Checker).convertUntyped(0x140001acfc0, 0x14000252cc0, {0x103352de8, 0x1034f3ce0})
        /opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/const.go:290 +0x30
go/types.(*Checker).matchTypes(0x140001acfc0, 0x14000252c80, 0x14000252cc0)
        /opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:928 +0x7c
go/types.(*Checker).binary(0x140001acfc0, 0x14000252c80, {0x1033538d0, 0x1400010bbf0}, {0x103353450, 0x14000152bc0}, {0x103353480, 0x14000152be0}, 0x28, 0x463)
        /opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:802 +0x114
go/types.(*Checker).exprInternal(0x140001acfc0, 0x0, 0x14000252c80, {0x1033538d0, 0x1400010bbf0}, {0x0, 0x0})
        /opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:1452 +0x1d4
go/types.(*Checker).rawExpr(0x140001acfc0, 0x0, 0x14000252c80, {0x1033538d0?, 0x1400010bbf0?}, {0x0?, 0x0?}, 0x0)
        /opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:981 +0x120
go/types.(*Checker).expr(0x140001acfc0, 0x103352a30?, 0x14000252c80, {0x1033538d0?, 0x1400010bbf0?})
        /opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:1549 +0x38
go/types.(*Checker).stmt(0x140001acfc0, 0x0, {0x103353a50, 0x14000129c80})
        /opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/stmt.go:579 +0xa3c
go/types.(*Checker).stmtList(0x140001acfc0, 0x0, {0x14000152d40?, 0x140001acfc0?, 0x140001519b8?})
        /opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/stmt.go:121 +0x88
go/types.(*Checker).funcBody(0x140001acfc0, 0x103353450?, {0x14000110900?, 0x103356b38?}, 0x140001bc780, 0x1400010bc80, {0x0?, 0x0?})
        /opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/stmt.go:41 +0x218
go/types.(*Checker).funcDecl.func1()
        /opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/decl.go:888 +0x44
go/types.(*Checker).processDelayed(0x140001acfc0, 0x0)
        /opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/check.go:516 +0x12c
go/types.(*Checker).checkFiles(0x140001acfc0, {0x14000114548, 0x1, 0x1})
        /opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/check.go:462 +0x1b4
go/types.(*Checker).Files(0x140000ac000?, {0x14000114548?, 0x1400012ade0?, 0x6?})
        /opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/check.go:422 +0x80
golang.org/x/tools/go/packages.(*loader).loadPackage(0x140000ac000, 0x1400028f2f0)
        /Users/Oleksandr_Redko/go/pkg/mod/golang.org/x/tools@v0.7.0/go/packages/packages.go:1052 +0x858
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
        /Users/Oleksandr_Redko/go/pkg/mod/golang.org/x/tools@v0.7.0/go/packages/packages.go:851 +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.7.0/go/packages/packages.go:839 +0x48
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1(0x0?)
        /Users/Oleksandr_Redko/go/pkg/mod/golang.org/x/tools@v0.7.0/go/packages/packages.go:846 +0x30
created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 30
        /Users/Oleksandr_Redko/go/pkg/mod/golang.org/x/tools@v0.7.0/go/packages/packages.go:845 +0x84
FAIL    github.com/ashanbrown/makezero/pkg/analyzer     0.708s
FAIL

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