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

wrapcheck panic after upgrading to go 1.22 #46

Closed
rledisez opened this issue Feb 19, 2024 · 1 comment · Fixed by #48
Closed

wrapcheck panic after upgrading to go 1.22 #46

rledisez opened this issue Feb 19, 2024 · 1 comment · Fixed by #48

Comments

@rledisez
Copy link
Contributor

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

goroutine 104 [running]:
go/types.(*Checker).handleBailout(0xc0003a0600, 0xc0009f9c60)
    /usr/local/go/src/go/types/check.go:367 +0x88
panic({0x81e080?, 0xba8470?})
    /usr/local/go/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0x942860, 0xbad080})
    /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({0x942860?, 0xbad080?})
    /usr/local/go/src/go/types/const.go:76 +0x9e
go/types.representableConst({0x944040, 0xb86640}, 0xc0003a0600, 0xbad080, 0xc0009f93d0)
    /usr/local/go/src/go/types/const.go:92 +0x192
go/types.(*Checker).representation(0xc0003a0600, 0xc00031e340, 0xbad080)
    /usr/local/go/src/go/types/const.go:256 +0x65
go/types.(*Checker).implicitTypeAndValue(0xc0003a0600, 0xc00031e340, {0x942888, 0xc0001982a0})
    /usr/local/go/src/go/types/expr.go:375 +0x30d
go/types.(*Checker).assignment(0xc0003a0600, 0xc00031e340, {0x942888, 0xc0001982a0}, {0x893ce4, 0x14})
    /usr/local/go/src/go/types/assignments.go:52 +0x2e5
go/types.(*Checker).initConst(0xc0003a0600, 0xc001c181e0, 0xc00031e340)
    /usr/local/go/src/go/types/assignments.go:126 +0x336
go/types.(*Checker).constDecl(0xc0003a0600, 0xc001c181e0, {0x943180, 0xc0002300c0}, {0x943180, 0xc0002300e0}, 0x0)
    /usr/local/go/src/go/types/decl.go:490 +0x348
go/types.(*Checker).objDecl(0xc0003a0600, {0x947ef8, 0xc001c181e0}, 0x0)
    /usr/local/go/src/go/types/decl.go:191 +0xa49
go/types.(*Checker).packageObjects(0xc0003a0600)
    /usr/local/go/src/go/types/resolver.go:693 +0x4dd
go/types.(*Checker).checkFiles(0xc0003a0600, {0xc00022e020, 0x2, 0x2})
    /usr/local/go/src/go/types/check.go:408 +0x1a5
go/types.(*Checker).Files(...)
    /usr/local/go/src/go/types/check.go:372
golang.org/x/tools/go/packages.(*loader).loadPackage(0xc0001421c0, 0xc0007a1d20)
    /root/go/pkg/mod/golang.org/x/tools@v0.1.12/go/packages/packages.go:1001 +0x76f
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
    /root/go/pkg/mod/golang.org/x/tools@v0.1.12/go/packages/packages.go:838 +0x1a9
sync.(*Once).doSlow(0x0?, 0x0?)
    /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(0x0?, 0x0?)
    /root/go/pkg/mod/golang.org/x/tools@v0.1.12/go/packages/packages.go:826 +0x4a
golang.org/x/tools/go/packages.(*loader).refine.func2(0x0?)
    /root/go/pkg/mod/golang.org/x/tools@v0.1.12/go/packages/packages.go:761 +0x26
created by golang.org/x/tools/go/packages.(*loader).refine in goroutine 1
    /root/go/pkg/mod/golang.org/x/tools@v0.1.12/go/packages/packages.go:760 +0xc9a

Upgrading dependency golang.org/x/tools to v0.18.0 fix the issue.

@rledisez
Copy link
Contributor Author

To be precise: golang.org/x/tools v0.13.0 is enough to fix the panic.

rledisez added a commit to rledisez/wrapcheck that referenced this issue Feb 19, 2024
tomarrell added a commit that referenced this issue Feb 19, 2024
* Upgrade dependency golang.org/x/tools

Closes #46

* update CI go version to 1.21

* upgrade test version to 1.22

* use go 1.21

* go 1.22

---------

Co-authored-by: Romain LE DISEZ <romain.le-disez@ovhcloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant