Skip to content

x/tools/go/pointer: internal error (panic) in pointer analysis - not a tagged object #43104

Closed
@zyq823

Description

@zyq823

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

$ go version 

go1.15.2 linux/amd64

Does this issue reproduce with the latest release?

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

go env Output
$ go env

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/xxx/.cache/go-build"
GOENV="/home/xxx/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/xxx/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/xxx/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/xxx/Downloads/research/xx/istio/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build086903914=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Running a go analyzer I wrote that incorporates the pointer package, on the istio codebase

What did you expect to see?

Error-free analysis that utilizes Go's pointer analysis package.

What did you see instead?

A panic error in the pointer analysis package was triggered. As shown below,

Internal panic in pointer analysis:
goroutine 1 [running]:
runtime/debug.Stack(0x24, 0x0, 0x0)
/usr/local/go/src/runtime/debug/stack.go:24 +0x9f
runtime/debug.PrintStack()
/usr/local/go/src/runtime/debug/stack.go:16 +0x25
golang.org/x/tools/go/pointer.Analyze.func1(0xc1fad78658)
/home/xxx/go/pkg/mod/golang.org/x/[email protected]/go/pointer/analysis.go:227 +0x10b
panic(0x6cc900, 0xc054a07080)
/usr/local/go/src/runtime/panic.go:969 +0x175
golang.org/x/tools/go/pointer.(*analysis).taggedValue(0xc0f5566a80, 0xc00009dacb, 0x4, 0x64, 0xc07c8d8700)
/home/xxx/go/pkg/mod/golang.org/x/[email protected]/go/pointer/gen.go:272 +0x105
golang.org/x/tools/go/pointer.(*typeFilterConstraint).solve(0xc0b7ae0940, 0xc0f5566a80, 0xc08e16d940)
/home/xxx/go/pkg/mod/golang.org/x/[email protected]/go/pointer/solve.go:273 +0xcc
golang.org/x/tools/go/pointer.(*analysis).solveConstraints(0xc0f5566a80, 0xc09b797620, 0xc08e16d940)
/home/xxx/go/pkg/mod/golang.org/x/[email protected]/go/pointer/solve.go:165 +0x178
golang.org/x/tools/go/pointer.(*analysis).solve(0xc0f5566a80)
/home/xxx/go/pkg/mod/golang.org/x/[email protected]/go/pointer/solve.go:59 +0x1ad
golang.org/x/tools/go/pointer.Analyze(0xc0f5a34a00, 0x0, 0x790a20, 0xc054a070b0)
/home/xxx/go/pkg/mod/golang.org/x/[email protected]/go/pointer/analysis.go:331 +0x4bc
main.(*analysis).pointerAnalysis(0xc000f42960, 0x798860, 0xc0eb11c660, 0x0, 0x797ea0, 0xc0eae465f0)
/home/xxx/Downloads/research/go2/race_checker/pointerAnalysis.go:25 +0x125
main.(*analysis).insMakeInterface(0xc000f42960, 0xc0eae465f0, 0x0, 0x797ea0, 0xc0eae465f0)
/home/xxx/Downloads/research/go2/race_checker/ssaInstructions.go:317 +0x1ac
main.(*analysis).visitAllInstructions(0xc000f42960, 0xc0786d5040, 0x0)
/home/xxx/Downloads/research/go2/race_checker/staticAnalysis.go:414 +0x1b1e
main.(*analysis).insCall(0xc000f42960, 0xc0931fb800, 0x0, 0x797240, 0xc0931fb800, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/xxx/Downloads/research/go2/race_checker/ssaInstructions.go:394 +0x452
main.(*analysis).visitAllInstructions(0xc000f42960, 0xc0786f3b80, 0x0)
/home/xxx/Downloads/research/go2/race_checker/staticAnalysis.go:416 +0x1da5
main.staticAnalysis(0xc0000ae030, 0x0, 0x0, 0x1, 0x0)
/home/xxx/Downloads/research/go2/race_checker/staticAnalysis.go:134 +0x99c
main.main()
/home/xxx/Downloads/research/go2/race_checker/main.go:150 +0x26d
FATA[13:01:11] internal error in pointer analysis: not a tagged object: n645835 (please report this bug)

Metadata

Metadata

Assignees

No one assigned

    Labels

    AnalysisIssues related to static analysis (vet, x/tools/go/analysis)FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolsThis label describes issues relating to any tools in the x/tools repository.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions