golang/go

cmd/compile: internal compiler error: newname nil

dvyukov opened this issue · 7 comments

gc crashes on the following program:

package a
import""
var?
go.go:3: internal compiler error: newname nil

go version devel +ef37184 Mon Jul 6 00:07:10 2015 +0000 linux/amd64

@dvyukov Can I ask how you are finding these bugs? Go Fuzz/random program generation? Are you hand reducing the test cases too?

@andrewchambers Yes, go-fuzz. Here is the test:
https://github.com/dvyukov/go-fuzz/blob/master/examples/gotypes/main.go
You can add llgo to the party as well.
Unfortunately it is quite messy because of all of the existing bugs. But what you can do is to compare llgo only to go/types (and exclude gc and gccgo invocations). If/when you run go-fuzz use -workdir=examples/goast because that dir contains an excessive corpus of inputs.

I cannot reproduce it with tip.

$ go version
go version devel +89a68e9 Sat Oct 3 16:37:18 2015 +0000 linux/amd64

$ go build fuz.go
can't load package:
fuz.go:2:7: invalid import path: ""

Maybe it is fixed? Can you reproduce on the specified revision?

Actually, I cannot reproduce, even on the specified revision.

$ cat fuz.go
package a
import""
var?

$ go version
go version devel +ef37184 Mon Jul 6 00:07:10 2015 +0000 linux/amd64

$ go build fuz.go
can't load package:
fuz.go:2:7: invalid import path: ""

Ok, I can produce the internal compiler error by invoking gc directly (go tool compile). It seems the error is caught by the go tool before gc is executed.

CL https://golang.org/cl/15268 mentions this issue.