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

orijtech/httperroryzer linter failing on Go 1.22rc2 with runtime error: invalid memory address or nil pointer dereference error #1326

Closed
atc0005 opened this issue Feb 5, 2024 · 1 comment · Fixed by #1328
Assignees
Labels
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Feb 5, 2024

Overview

This linter is failing in the same way that the orijtech/structslop linter is for Go 1.22rc2:

root@33735e4cad59:/go/check-restart# httperroryzer ./...
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=0x598d7e]

goroutine 77 [running]:
go/types.(*Checker).handleBailout(0xc0005a9c00, 0xc000155c68)
        /usr/local/go/src/go/types/check.go:367 +0x88
panic({0x7161e0?, 0x99da50?})
        /usr/local/go/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0x7e3310, 0x9a18e0})
        /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({0x7e3310?, 0x9a18e0?})
        /usr/local/go/src/go/types/const.go:76 +0x9e
go/types.representableConst({0x7e4730, 0x996380}, 0xc0005a9c00, 0x9a18e0, 0xc0001530a0)
        /usr/local/go/src/go/types/const.go:92 +0x192
go/types.(*Checker).representation(0xc0005a9c00, 0xc000267ec0, 0x9a18e0)
        /usr/local/go/src/go/types/const.go:256 +0x65
go/types.(*Checker).implicitTypeAndValue(0xc0005a9c00, 0xc000267ec0, {0x7e3310, 0x9a18e0})
        /usr/local/go/src/go/types/expr.go:375 +0x30d
go/types.(*Checker).assignment(0xc0005a9c00, 0xc000267ec0, {0x7e3310, 0x9a18e0}, {0x76ba3e, 0x10})
        /usr/local/go/src/go/types/assignments.go:52 +0x2e5
go/types.(*Checker).initVar(0xc0005a9c00, 0xc00029cfc0, 0xc000267ec0, {0x76ba3e, 0x10})
        /usr/local/go/src/go/types/assignments.go:163 +0x41e
go/types.(*Checker).initVars(0xc0005a9c00, {0xc0002902c0, 0x1, 0x7e3310?}, {0xc00001a260, 0x9a18c0?, 0xc00029d2c0?}, {0x7e3fc8, 0xc0000149a0})
        /usr/local/go/src/go/types/assignments.go:382 +0x638
go/types.(*Checker).stmt(0xc0005a9c00, 0x0, {0x7e3fc8, 0xc0000149a0})
        /usr/local/go/src/go/types/stmt.go:524 +0x1fc5
go/types.(*Checker).stmtList(0xc0005a9c00, 0x0, {0xc00001a270?, 0x768056?, 0x5?})
        /usr/local/go/src/go/types/stmt.go:121 +0x85
go/types.(*Checker).stmt(0xc0005a9c00, 0x0, {0x7e4058, 0xc000074630})
        /usr/local/go/src/go/types/stmt.go:562 +0x20f2
go/types.(*Checker).stmt(0xc0005a9c00, 0x0, {0x7e4088, 0xc000072580})
        /usr/local/go/src/go/types/stmt.go:574 +0x3017
go/types.(*Checker).stmtList(0xc0005a9c00, 0x0, {0xc000078180?, 0x0?, 0xc00029f6c8?})
        /usr/local/go/src/go/types/stmt.go:121 +0x85
go/types.(*Checker).funcBody(0xc0005a9c00, 0x7e3310?, {0xc0000121d0?, 0x9a18e0?}, 0xc000a0a240, 0xc000074780, {0x0?, 0x0?})
        /usr/local/go/src/go/types/stmt.go:41 +0x331
go/types.(*Checker).funcDecl.func1()
        /usr/local/go/src/go/types/decl.go:852 +0x3a
go/types.(*Checker).processDelayed(0xc0005a9c00, 0x0)
        /usr/local/go/src/go/types/check.go:467 +0x162
go/types.(*Checker).checkFiles(0xc0005a9c00, {0xc00004a040, 0x1, 0x1})
        /usr/local/go/src/go/types/check.go:411 +0x1cc
go/types.(*Checker).Files(...)
        /usr/local/go/src/go/types/check.go:372
golang.org/x/tools/go/packages.(*loader).loadPackage(0xc000112000, 0xc00059a980)
        /go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:955 +0x72f
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
        /go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:793 +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?)
        /go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:781 +0x4a
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1(0x0?)
        /go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:788 +0x26
created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 76
        /go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:787 +0x94

root@33735e4cad59:/go/httperroryzer# go get -u ./...
go: upgraded golang.org/x/tools v0.0.0-20201114224030-61ea331ec02b => v0.17.0
go: upgraded golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 => v0.0.0-20231012003039-104605ab7028

root@33735e4cad59:/go/httperroryzer# cd ..
root@33735e4cad59:/go# cd check-restart
root@33735e4cad59:/go/check-restart# httperroryzer ./...

Updating the dependencies (golang.org/x/tools) appears to resolve the issue.

References

@atc0005 atc0005 added bug Something isn't working unstable linting labels Feb 5, 2024
@atc0005 atc0005 added this to the Next Release milestone Feb 5, 2024
@atc0005 atc0005 self-assigned this Feb 5, 2024
atc0005 added a commit that referenced this issue Feb 5, 2024
Switch from upstream projects to temporary forks until the
dependencies for those upstream projects are updated to work
with newer Go versions.

refs GH-1325
refs GH-1326
refs GH-1327
atc0005 added a commit that referenced this issue Feb 5, 2024
Switch from upstream projects to temporary forks until the
dependencies for those upstream projects are updated to work
with newer Go versions.

refs GH-1325
refs GH-1326
refs GH-1327
@atc0005
Copy link
Owner Author

atc0005 commented Feb 5, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant