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

サービス側でgo mod tidyしたらnilpoエラーが出るようになった #24

Closed
hrdtbs opened this issue Apr 23, 2024 · 4 comments

Comments

@hrdtbs
Copy link
Member

hrdtbs commented Apr 23, 2024

これと同じエラー:#17 (comment)

go: added github.com/pkg/errors v0.9.1
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=0x5983af]

goroutine 97 [running]:
go/types.(*Checker).handleBailout(0xc0004ce600, 0xc00127fbd0)
        /usr/local/go/src/go/types/check.go:367 +0x88
panic({0x717c40?, 0x9a1a00?})
        /usr/local/go/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0x7e67a8, 0x9a57c0})
        /usr/local/go/src/go/types/sizes.go:228 +0x30f
go/types.(*Config).sizeof(...)
        /usr/local/go/src/go/types/sizes.go:333
go/types.representableConst.func1({0x7e67a8?, 0x9a57c0?})
        /usr/local/go/src/go/types/const.go:76 +0x9e
go/types.representableConst({0x7e7b38, 0x99a360}, 0xc0004ce600, 0x9a57c0, 0xc00127e7e8)
        /usr/local/go/src/go/types/const.go:92 +0x192
go/types.(*Checker).representation(0xc0004ce600, 0xc001320680, 0x9a57c0)
        /usr/local/go/src/go/types/const.go:256 +0x65
go/types.(*Checker).implicitTypeAndValue(0xc0004ce600, 0xc001320680, {0x7e67a8, 0x9a57c0})
        /usr/local/go/src/go/types/expr.go:375 +0x2d7
go/types.(*Checker).assignment(0xc0004ce600, 0xc001320680, {0x7e67a8, 0x9a57c0}, {0x76e44d, 0x10})
        /usr/local/go/src/go/types/assignments.go:52 +0x2e5
go/types.(*Checker).initVar(0xc0004ce600, 0xc000bf5b60, 0xc001320680, {0x76e44d, 0x10})
        /usr/local/go/src/go/types/assignments.go:163 +0x3b2
go/types.(*Checker).initVars(0xc0004ce600, {0xc000d376d0, 0x2, 0xc000eb6a90?}, {0xc000eee4e0, 0xc00127f360?, 0xc000eb6aa0?}, {0x7e73f8, 0xc000eee500})
        /usr/local/go/src/go/types/assignments.go:382 +0x638
go/types.(*Checker).stmt(0xc0004ce600, 0x0, {0x7e73f8, 0xc000eee500})
        /usr/local/go/src/go/types/stmt.go:524 +0x1fc5
go/types.(*Checker).stmtList(0xc0004ce600, 0x0, {0xc000eee520?, 0x0?, 0x45275e?})
        /usr/local/go/src/go/types/stmt.go:121 +0x85
go/types.(*Checker).funcBody(0xc0004ce600, 0x7e67a8?, {0xc000499830?, 0x9a57a0?}, 0xc001178dc0, 0xc000ebaba0, {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(0xc0004ce600, 0x0)
        /usr/local/go/src/go/types/check.go:467 +0x162
go/types.(*Checker).checkFiles(0xc0004ce600, {0xc000d18b40, 0xc, 0xc})
        /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(0xc0001a60e0, 0xc000301530)
        /home/circleci/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:1052 +0xa72
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
        /home/circleci/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:851 +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?)
        /home/circleci/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:839 +0x4a
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1.1(0x0?)
        /home/circleci/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:846 +0x26
created by golang.org/x/tools/go/packages.(*loader).loadRecursive.func1 in goroutine 76
        /home/circleci/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:845 +0x94
exit status 2
@hrdtbs
Copy link
Member Author

hrdtbs commented Apr 23, 2024

Workaround

サービス側で

go get golang.org/x/tools

を実行して、golang.org/x/toolsを追加する。

エラーログから推測して実行したら治った。

@hrdtbs
Copy link
Member Author

hrdtbs commented Apr 23, 2024

そもそもgolint-extra、2年前からリリースされていない。
https:/matsuri-tech/golint-extra/releases/tag/v0.3.1

これにより利用側でgolang.org/x/toolsの新しいバージョンが入っていない場合、問題がある古いgolang.org/x/toolsがインストールされることが原因っぽい。

toolsを入れていない状態で、go get github.com/matsuri-tech/golint-extraを実行したら tools v0.6.0が入ることを確認した。

@hrdtbs
Copy link
Member Author

hrdtbs commented Apr 23, 2024

リリースを実行して、tools v0.20.0が入ることを確認した。
https:/matsuri-tech/golint-extra/releases/tag/v0.4.0

@hrdtbs hrdtbs closed this as completed Apr 23, 2024
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

No branches or pull requests

1 participant