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/pointer: internal error in pointer analysis: node has no enclosing object #58801

Closed
BarrensZeppelin opened this issue Mar 1, 2023 · 4 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@BarrensZeppelin
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.20.1 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/zii/.cache/go-build"
GOENV="/home/zii/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/zii/gopath/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/zii/gopath"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/snap/go/10055"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/snap/go/10055/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.1"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1802674291=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Running the pointer analysis on a docker package as described in https://github.com/BarrensZeppelin/go-pointer-analysis-bug yields the following panic:

Internal panic in pointer analysis:
goroutine 1 [running]:
runtime/debug.Stack()
	/snap/go/10055/src/runtime/debug/stack.go:24 +0x65
runtime/debug.PrintStack()
	/snap/go/10055/src/runtime/debug/stack.go:16 +0x19
golang.org/x/tools/go/pointer.Analyze.func1()
	/home/zii/tmp/moby/gopath/src/golang.org/x/tools/go/pointer/analysis.go:225 +0xca
panic({0x6785a0, 0x729880})
	/snap/go/10055/src/runtime/panic.go:884 +0x213
golang.org/x/tools/go/pointer.(*analysis).enclosingObj(...)
	/home/zii/tmp/moby/gopath/src/golang.org/x/tools/go/pointer/analysis.go:157
golang.org/x/tools/go/pointer.(*hvn).markIndirectNodes(0x6b8380?)
	/home/zii/tmp/moby/gopath/src/golang.org/x/tools/go/pointer/hvn.go:483 +0x338
golang.org/x/tools/go/pointer.(*analysis).hvn(0xc0589dec00)
	/home/zii/tmp/moby/gopath/src/golang.org/x/tools/go/pointer/hvn.go:279 +0x2e5
golang.org/x/tools/go/pointer.Analyze(0xc033b9d810)
	/home/zii/tmp/moby/gopath/src/golang.org/x/tools/go/pointer/analysis.go:321 +0xc86
main.main()
	/home/zii/tmp/moby/main.go:58 +0x707
Failed pointer analysis
internal error in pointer analysis: node has no enclosing object (please report this bug)
exit status 1

If no queries are added to the analysis configuration the panic does not occur.

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Mar 1, 2023
@gopherbot gopherbot added this to the Unreleased milestone Mar 1, 2023
@dmitshur
Copy link
Contributor

dmitshur commented Mar 1, 2023

CC @timothy-king, @alandonovan.

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 1, 2023
@BarrensZeppelin
Copy link
Author

@adonovan is the correct user for Alan, no?

@adonovan
Copy link
Member

adonovan commented Mar 13, 2023

Both GitHub aliases will reach me. But go/pointer is pretty far down my list of priorities. An unfortunate feature of its design is that it is quite sensitive to internal changes in low-level packages. It's also too slow and expensive for most applications. I'm tempted to tag and delete it from x/tools.

@adonovan
Copy link
Member

x/tools/go/pointer was deleted; see #59676.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. 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