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/cmd/godoc: Panic in loader.(*importer).addFiles #11012

Closed
jacobsa opened this issue Jun 1, 2015 · 5 comments
Closed

x/tools/cmd/godoc: Panic in loader.(*importer).addFiles #11012

jacobsa opened this issue Jun 1, 2015 · 5 comments

Comments

@jacobsa
Copy link
Contributor

jacobsa commented Jun 1, 2015

I'm running Go 1.4.2 installed from homebrew on OS X:

% go version
go version go1.4.2 darwin/amd64

% go env
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/jacobsa/go"
GORACE=""
GOROOT="/Users/jacobsa/.homebrew/Cellar/go/1.4.2/libexec"
GOTOOLDIR="/Users/jacobsa/.homebrew/Cellar/go/1.4.2/libexec/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"

I've just a minute ago updated godoc to golang/tools@8ccf558 using:

go get -u -v golang.org/x/tools/godoc

When I run it like this:

godoc -analysis type,pointer -http :1234

It always crashes after 5-6 seconds with:

2015/06/01 11:02:30 Loading and type-checking packages...
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x37d816]

goroutine 1111 [running]:
golang.org/x/tools/go/loader.(*importer).addFiles(0xc2081fc000, 0x0, 0xb2e9a0, 0x0, 0x0, 0x0)
        /private/tmp/go20150526-58358-v7wg96/go/src/golang.org/x/tools/go/loader/loader.go:1108 +0x276
golang.org/x/tools/go/loader.(*Config).Load(0xc20813e140, 0x7ff750, 0x0, 0x0)
        /private/tmp/go20150526-58358-v7wg96/go/src/golang.org/x/tools/go/loader/loader.go:710 +0x1b39
golang.org/x/tools/godoc/analysis.Run(0x6e2001, 0xc208036b30)
        /private/tmp/go20150526-58358-v7wg96/go/src/golang.org/x/tools/godoc/analysis/analysis.go:378 +0xc17
created by main.main
        /private/tmp/go20150526-58358-v7wg96/go/src/golang.org/x/tools/cmd/godoc/main.go:307 +0x1af0

goroutine 1 [IO wait]:
net.(*pollDesc).Wait(0xc2084f2290, 0x72, 0x0, 0x0)
        /Users/jacobsa/.homebrew/Cellar/go/1.4.2/libexec/src/net/fd_poll_runtime.go:84 +0x47
net.(*pollDesc).WaitRead(0xc2084f2290, 0x0, 0x0)
        /Users/jacobsa/.homebrew/Cellar/go/1.4.2/libexec/src/net/fd_poll_runtime.go:89 +0x43
net.(*netFD).accept(0xc2084f2230, 0x0, 0xc39e30, 0xc2082696b8)
        /Users/jacobsa/.homebrew/Cellar/go/1.4.2/libexec/src/net/fd_unix.go:419 +0x40b
net.(*TCPListener).AcceptTCP(0xc2084aada0, 0x934e4, 0x0, 0x0)
        /Users/jacobsa/.homebrew/Cellar/go/1.4.2/libexec/src/net/tcpsock_posix.go:234 +0x4e
net/http.tcpKeepAliveListener.Accept(0xc2084aada0, 0x0, 0x0, 0x0, 0x0)
        /Users/jacobsa/.homebrew/Cellar/go/1.4.2/libexec/src/net/http/server.go:1976 +0x4c
net/http.(*Server).Serve(0xc2086d2cc0, 0xc55738, 0xc2084aada0, 0x0, 0x0)
        /Users/jacobsa/.homebrew/Cellar/go/1.4.2/libexec/src/net/http/server.go:1728 +0x92
net/http.(*Server).ListenAndServe(0xc2086d2cc0, 0x0, 0x0)
        /Users/jacobsa/.homebrew/Cellar/go/1.4.2/libexec/src/net/http/server.go:1718 +0x154
net/http.ListenAndServe(0x7fff5fbffafb, 0x5, 0xc54670, 0xc20803c990, 0x0, 0x0)
        /Users/jacobsa/.homebrew/Cellar/go/1.4.2/libexec/src/net/http/server.go:1808 +0xba
main.main()
        /private/tmp/go20150526-58358-v7wg96/go/src/golang.org/x/tools/cmd/godoc/main.go:311 +0x192e

goroutine 1093 [sleep]:
golang.org/x/tools/godoc.(*Corpus).refreshMetadataLoop(0xc2080369c0)
        /private/tmp/go20150526-58358-v7wg96/go/src/golang.org/x/tools/godoc/meta.go:142 +0x62
created by golang.org/x/tools/godoc.(*Corpus).Init
        /private/tmp/go20150526-58358-v7wg96/go/src/golang.org/x/tools/godoc/corpus.go:145 +0x89

Here is a full log.

@mikioh mikioh changed the title godoc: Panic in loader.(*importer).addFiles x/tools/cmd/godoc: Panic in loader.(*importer).addFiles Jun 1, 2015
@ianlancetaylor ianlancetaylor added this to the Go1.5Maybe milestone Jun 3, 2015
@rsc
Copy link
Contributor

rsc commented Jul 21, 2015

This comment is clearly false:

    info := imp.imported[path].info // must be non-nil, see above

addFiles is being called with info == nil.

Does this also happen with godoc compiled against Go 1.5?
If it's a skew problem, like the current tip godoc not being able to read Go 1.4 object files, I'm less concerned.

@jacobsa
Copy link
Contributor Author

jacobsa commented Jul 21, 2015

I haven't seen this in weeks; I'm willing to say it was either fixed or was due to version skew caused by me.

@jacobsa
Copy link
Contributor Author

jacobsa commented Jul 21, 2015

(To be clear: for the weeks I mention I've been building Go from tip.)

@jeffallen
Copy link
Contributor

(comment deleted; my golang/x/tools was apparently not on tip when I thought I was able to repro it)

@rsc
Copy link
Contributor

rsc commented Jul 28, 2015

Retracted by @jacobsa

@rsc rsc closed this as completed Jul 28, 2015
@golang golang locked and limited conversation to collaborators Aug 5, 2016
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

6 participants