uber-go / nilaway

Static analysis tool to detect potential nil panics in Go code
Apache License 2.0
3.07k stars 62 forks source link

panic on main(67945fb) #214

Open dkropachev opened 7 months ago

dkropachev commented 7 months ago

Unfortunately can't provide project I am running on, but here is the stack:

[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x63cdba]

goroutine 24202 [running]:
golang.org/x/tools/go/ssa.memberFromObject(0xc0271f8900, {0x0, 0x0?}, {0x904c30, 0xc02dc27720}, {0x0, 0x0})
        /go/pkg/mod/golang.org/x/tools@v0.18.0/go/ssa/create.go:55 +0x5a
golang.org/x/tools/go/ssa.membersFromDecl(0xc0271f8900, {0x905350?, 0xc043cf9900?}, {0x0, 0x0})
        /go/pkg/mod/golang.org/x/tools@v0.18.0/go/ssa/create.go:171 +0x37d
golang.org/x/tools/go/ssa.(*Program).CreatePackage(0xc016969ee0, 0xc0859bb200, {0xc0430f6fc0, 0x7, 0x7}, 0xc003f95450, 0x0)
        /go/pkg/mod/golang.org/x/tools@v0.18.0/go/ssa/create.go:250 +0x865
golang.org/x/tools/go/analysis/passes/buildssa.run(0xc016969e10)
        /go/pkg/mod/golang.org/x/tools@v0.18.0/go/analysis/passes/buildssa/buildssa.go:58 +0x2b9
golang.org/x/tools/go/analysis/internal/checker.(*action).execOnce(0xc0374c4640)
        /go/pkg/mod/golang.org/x/tools@v0.18.0/go/analysis/internal/checker/checker.go:775 +0x9f7
sync.(*Once).doSlow(0xc0022f27b8?, 0xc0022f27d0?)
        /go/go1.21.6/src/sync/once.go:74 +0xbf
sync.(*Once).Do(...)
        /go/go1.21.6/src/sync/once.go:65
golang.org/x/tools/go/analysis/internal/checker.(*action).exec(...)
        /go/pkg/mod/golang.org/x/tools@v0.18.0/go/analysis/internal/checker/checker.go:691
golang.org/x/tools/go/analysis/internal/checker.execAll.func1(0x0?)
        /go/pkg/mod/golang.org/x/tools@v0.18.0/go/analysis/internal/checker/checker.go:679 +0x45
created by golang.org/x/tools/go/analysis/internal/checker.execAll in goroutine 24200
        /go/pkg/mod/golang.org/x/tools@v0.18.0/go/analysis/internal/checker/checker.go:685 +0x15a
dkropachev commented 7 months ago

original issue from go repo - https://github.com/golang/go/issues/65608

dkropachev commented 7 months ago

what helped me to fix it is rebuilding nilaway with golang v1.22

yuxincs commented 6 months ago

Thanks for reporting. I guess there are not many things we can do from NilAway's end but to advise building with Go 1.22 (which we support).

Seems to be a deeper issue that the Go team has more context on. We'll monitor that linked issue and act on it if there are some workarounds other than building with Go 1.22

dkropachev commented 6 months ago

Thanks for reporting. I guess there are not many things we can do from NilAway's end but to advise building with Go 1.22 (which we support).

Seems to be a deeper issue that the Go team has more context on. We'll monitor that linked issue and act on it if there are some workarounds other than building with Go 1.22

As I expected, thanks for confirming. On my end it is solved, feel free to close it.