Skip to content

Upgraded golang.org/x/tools to v0.21.0 - fixes panic when compiled wi… #10

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 1 commit into from
May 7, 2024

Conversation

iis256
Copy link

@iis256 iis256 commented May 7, 2024

A panic occures when tagalign is compiled with go 1.22:

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

goroutine 14 [running]:
go/types.(*Checker).handleBailout(0xc0003d0e00, 0xc00125bbd0)
        /snap/go/10585/src/go/types/check.go:367 +0x88
panic({0x716b20?, 0x99ea20?})
        /snap/go/10585/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0x7e4ed8, 0x9a26e0})
        /snap/go/10585/src/go/types/sizes.go:228 +0x30f
go/types.(*Config).sizeof(...)
        /snap/go/10585/src/go/types/sizes.go:333
go/types.representableConst.func1({0x7e4ed8?, 0x9a26e0?})
        /snap/go/10585/src/go/types/const.go:76 +0x9e
go/types.representableConst({0x7e6210, 0x9973a0}, 0xc0003d0e00, 0x9a26e0, 0xc001259e50)
        /snap/go/10585/src/go/types/const.go:92 +0x192
go/types.(*Checker).representation(0xc0003d0e00, 0xc000c22fc0, 0x9a26e0)
        /snap/go/10585/src/go/types/const.go:256 +0x65
go/types.(*Checker).implicitTypeAndValue(0xc0003d0e00, 0xc000c22fc0, {0x7e4ed8, 0x9a26e0})
        /snap/go/10585/src/go/types/expr.go:375 +0x2d7
go/types.(*Checker).assignment(0xc0003d0e00, 0xc000c22fc0, {0x7e4ed8, 0x9a26e0}, {0x76b4b5, 0xb})
        /snap/go/10585/src/go/types/assignments.go:52 +0x2e5
go/types.(*Checker).exprInternal(0xc0003d0e00, 0x0, 0xc000c22fc0, {0x7e5680, 0xc0009b7f40}, {0x0, 0x0})
        /snap/go/10585/src/go/types/expr.go:1268 +0x2b6c
go/types.(*Checker).rawExpr(0xc0003d0e00, 0x0, 0xc000c22fc0, {0x7e5680?, 0xc0009b7f40?}, {0x0?, 0x0?}, 0x0)
        /snap/go/10585/src/go/types/expr.go:979 +0x19e
go/types.(*Checker).expr(0xc0003d0e00, 0xc000b524c0?, 0xc000c22fc0, {0x7e5680?, 0xc0009b7f40?})
        /snap/go/10585/src/go/types/expr.go:1513 +0x30
go/types.(*Checker).initVars(0xc0003d0e00, {0xc000eb6948, 0x1, 0xc0009b3c50?}, {0xc000f0be50, 0x1?, 0xc000f0bdc0?}, {0x7e5aa0, 0xc0009c1080})
        /snap/go/10585/src/go/types/assignments.go:381 +0x60b
go/types.(*Checker).stmt(0xc0003d0e00, 0x0, {0x7e5aa0, 0xc0009c1080})
        /snap/go/10585/src/go/types/stmt.go:524 +0x1fc5
go/types.(*Checker).stmtList(0xc0003d0e00, 0x0, {0xc000f0be60?, 0x0?, 0xc000e27948?})
        /snap/go/10585/src/go/types/stmt.go:121 +0x85
go/types.(*Checker).funcBody(0xc0003d0e00, 0x7e5090?, {0xc0003dae28?, 0xc000b524c0?}, 0xc00112ee80, 0xc0009b3f50, {0x0?, 0x0?})
        /snap/go/10585/src/go/types/stmt.go:41 +0x331
go/types.(*Checker).funcDecl.func1()
        /snap/go/10585/src/go/types/decl.go:852 +0x3a
go/types.(*Checker).processDelayed(0xc0003d0e00, 0x0)
        /snap/go/10585/src/go/types/check.go:467 +0x162
go/types.(*Checker).checkFiles(0xc0003d0e00, {0xc00014c848, 0x55, 0x55})
        /snap/go/10585/src/go/types/check.go:411 +0x1cc
go/types.(*Checker).Files(...)
        /snap/go/10585/src/go/types/check.go:372
golang.org/x/tools/go/packages.(*loader).loadPackage(0xc00015a0e0, 0xc0004cb0b0)
        /home/igor/go/pkg/mod/golang.org/x/tools@v0.7.0/go/packages/packages.go:1052 +0xa72
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
        /home/igor/go/pkg/mod/golang.org/x/tools@v0.7.0/go/packages/packages.go:851 +0x1a9
sync.(*Once).doSlow(0x0?, 0x0?)
        /snap/go/10585/src/sync/once.go:74 +0xc2
sync.(*Once).Do(...)
        /snap/go/10585/src/sync/once.go:65
golang.org/x/tools/go/packages.(*loader).loadRecursive(0x0?, 0x0?)
        /home/igor/go/pkg/mod/golang.org/x/tools@v0.7.0/go/packages/packages.go:839 +0x4a
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1(0x0?)
        /home/igor/go/pkg/mod/golang.org/x/tools@v0.7.0/go/packages/packages.go:846 +0x26
created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 12
        /home/igor/go/pkg/mod/golang.org/x/tools@v0.7.0/go/packages/packages.go:845 +0x94

The problem is in outdated golang.org/x/tools.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…th go 1.22
@4meepo 4meepo merged commit e25313b into 4meepo:main May 7, 2024
1 check passed
@4meepo
Copy link
Owner

4meepo commented May 7, 2024

Thanks for your contribution ❤️

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