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/packages: panics with mode LoadTypes #26834

Closed
suzmue opened this issue Aug 7, 2018 · 1 comment
Closed

x/tools/go/packages: panics with mode LoadTypes #26834

suzmue opened this issue Aug 7, 2018 · 1 comment

Comments

@suzmue
Copy link
Contributor

suzmue commented Aug 7, 2018

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

go version devel +9594ba4fe5 Fri Aug 3 15:44:22 2018 +0000 darwin/amd64

Does this issue reproduce with the latest release?

n/a, testing with tip

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/suzmue/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/suzmue/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go/"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/c4/982kvfgd4jz6_6sdlzzk2nj400fkl_/T/go-build214909991=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

$ go get -u golang.org/x/tools/go/packages/...
$ gopackages -mode=types fmt

What did you expect to see?

A Go package for fmt:

Go package "fmt":
	package fmt
	has incomplete exported type info
	file /usr/local/go/src/fmt/doc.go
	file /usr/local/go/src/fmt/format.go
	file /usr/local/go/src/fmt/print.go
	file /usr/local/go/src/fmt/scan.go
	import "errors"
	import "io"
	import "math"
	import "os"
	import "reflect"
	import "strconv"
	import "sync"
	import "unicode/utf8"

What did you see instead?

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x12032b2]

goroutine 56 [running]:
golang.org/x/tools/go/packages.(*loader).parseFiles.func1(0xc0000920c0, 0xc00000a400, 0xc00000a420, 0xc0000145a0, 0x1, 0xc0001e07c0, 0x3b)
/Users/suzmue/go/src/golang.org/x/tools/go/packages/packages.go:591 +0x62
created by golang.org/x/tools/go/packages.(*loader).parseFiles
/Users/suzmue/go/src/golang.org/x/tools/go/packages/packages.go:588 +0x1d8

cc @matloob

@suzmue suzmue added this to the Unreleased milestone Aug 7, 2018
@gopherbot
Copy link

Change https://golang.org/cl/128365 mentions this issue: go/packages: use export data to load type information

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants