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

x/tools/go/ssa: panic recovered: interface conversion: ssa.Member is *ssa.NamedConst, not *ssa.Function #58447

Open
prattmic opened this issue Feb 9, 2023 · 1 comment
Assignees
Labels
Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@prattmic
Copy link
Member

prattmic commented Feb 9, 2023

buildssa seems to choke on os/user/cgo_listgroups_unix.go:

checkescape: third_party/go/gc/src/os/user/cgo_listgroups_unix.go: panic recovered: interface conversion: ssa.Member is *ssa.NamedConst, not *ssa.Function (goroutine 53148 [running]:
runtime/debug.Stack()
        third_party/go/gc/src/runtime/debug/stack.go:24 +0x65
google3/third_party/gvisor/tools/nogo/check/check.(*importer).checkPackage.func2.9()
        third_party/gvisor/tools/nogo/check/check.go:554 +0xa5
panic({0x5588cf6c5260, 0xc00d4c61e0})
        third_party/go/gc/src/runtime/panic.go:890 +0x263
google3/third_party/golang/go_tools/go/ssa/ssa.(*builder).expr0(0xc00e20f9f8, 0xc00b232f00, {0x5588cf74d5d0?, 0xc0094935c0?}, {0x0, {0x0, 0x0}, {0x0, 0x0}})
        third_party/golang/go_tools/go/ssa/builder.go:802 +0x21a5
google3/third_party/golang/go_tools/go/ssa/ssa.(*builder).expr(0x5588cf6ba680?, 0xc00b232f00, {0x5588cf74d5d0, 0xc0094935c0})
        third_party/golang/go_tools/go/ssa/builder.go:625 +0x17b
google3/third_party/golang/go_tools/go/ssa/ssa.(*builder).expr0(0xc00e20f9f8, 0xc00b232f00, {0x5588cf74d2d0?, 0xc003fe4e40?}, {0x0, {0x0, 0x0}, {0x0, 0x0}})
        third_party/golang/go_tools/go/ssa/builder.go:676 +0x705
google3/third_party/golang/go_tools/go/ssa/ssa.(*builder).expr(0x5588cef4cf2d?, 0xc00b232f00, {0x5588cf74d2d0, 0xc003fe4e40})
        third_party/golang/go_tools/go/ssa/builder.go:625 +0x17b
google3/third_party/golang/go_tools/go/ssa/ssa.(*builder).assign(0x5588cf6bae60?, 0xc00d4aeba0?, {0x5588cf74e548?, 0xc00d4c61b0}, {0x5588cf74d2d0?, 0xc003fe4e40?}, 0x80?, 0x0)
        third_party/golang/go_tools/go/ssa/builder.go:598 +0x3db
google3/third_party/golang/go_tools/go/ssa/ssa.(*Package).build(0xc00af2b900)
        third_party/golang/go_tools/go/ssa/builder.go:2554 +0xb3f
sync.(*Once).doSlow(0xc0630fc900?, 0xc008eac050?)
        third_party/go/gc/src/sync/once.go:74 +0xc2
sync.(*Once).Do(...)
        third_party/go/gc/src/sync/once.go:65
google3/third_party/golang/go_tools/go/ssa/ssa.(*Package).Build(...)
        third_party/golang/go_tools/go/ssa/builder.go:2477
google3/third_party/golang/go_tools/go/analysis/passes/buildssa/buildssa.run(0xc000175590)
        third_party/golang/go_tools/go/analysis/passes/buildssa/buildssa.go:72 +0x1a8
google3/third_party/gvisor/tools/nogo/check/check.(*importer).checkPackage.func2(0x5588cfade540, 0x0?)
        third_party/gvisor/tools/nogo/check/check.go:579 +0xd18
created by google3/third_party/gvisor/tools/nogo/check/check.(*importer).checkPackage
        third_party/gvisor/tools/nogo/check/check.go:403 +0xbd6
)

This is running through a slight variant https://github.com/google/gvisor/tree/master/tools/nogo. FWIW, I wasn't able to trivially reproduce this with a buildssa singlechecker. If this stack trace isn't sufficient, I can help run the original analyzer.

cc @timothy-king @zpavlinovic @adonovan @amscanne

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Feb 9, 2023
@gopherbot gopherbot added this to the Unreleased milestone Feb 9, 2023
@adonovan
Copy link
Member

adonovan commented Feb 9, 2023

The intended invariant here is that ssa.builder.expr0 is not called for constants because they should be handled in builder.expr, but somehow the type checker is producing a TypeAndValue with .Value=nil for an Ident referencing a package-level named constant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants