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

cmd/compile: internal compiler error #15961

Closed
cznic opened this issue Jun 5, 2016 · 6 comments
Closed

cmd/compile: internal compiler error #15961

cznic opened this issue Jun 5, 2016 · 6 comments
Milestone

Comments

@cznic
Copy link
Contributor

cznic commented Jun 5, 2016

  1. What version of Go are you using (go version)?
    go1.7beta1 3c6b668
  2. What operating system and processor architecture are you using (go env)?
    Linux (Ubuntu Mate 16.04 LTS) 64bit / x86_64.
  3. What did you do?
$ cd $GOPATH/src/github.com/cznic/y
$ go test
  1. What did you expect to see?
    PASS
  2. What did you see instead?
jnml@4670:~/src/github.com/cznic/y$ go test
# github.com/cznic/y
<autogenerated>:6: internal compiler error: want FUNC, but have int

goroutine 1 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
    /home/jnml/go/src/runtime/debug/stack.go:24 +0x79
cmd/compile/internal/gc.Fatalf(0x8f8c0c, 0x14, 0xc421ab5500, 0x2, 0x2)
    /home/jnml/go/src/cmd/compile/internal/gc/subr.go:165 +0x248
cmd/compile/internal/gc.(*Type).wantEtype(0xc4203ae190, 0x13)
    /home/jnml/go/src/cmd/compile/internal/gc/type.go:676 +0xe7
cmd/compile/internal/gc.(*Type).ResultsP(0xc4203ae190, 0x0)
    /home/jnml/go/src/cmd/compile/internal/gc/type.go:697 +0x30
cmd/compile/internal/gc.(*Type).Results(0xc4203ae190, 0xc421b59200)
    /home/jnml/go/src/cmd/compile/internal/gc/type.go:703 +0x2b
cmd/compile/internal/gc.initEscretval(0xc421b26b40, 0xc421b59200, 0xc4203ae190)
    /home/jnml/go/src/cmd/compile/internal/gc/esc.go:1387 +0x86
cmd/compile/internal/gc.esccall(0xc421b26b40, 0xc421b59200, 0xc421b59290)
    /home/jnml/go/src/cmd/compile/internal/gc/esc.go:1540 +0xe4e
cmd/compile/internal/gc.esc(0xc421b26b40, 0xc421b59200, 0xc421b59290)
    /home/jnml/go/src/cmd/compile/internal/gc/esc.go:796 +0x64d
cmd/compile/internal/gc.esclist(0xc421b26b40, 0xc4208eeb20, 0xc421b59290)
    /home/jnml/go/src/cmd/compile/internal/gc/esc.go:602 +0x68
cmd/compile/internal/gc.esc(0xc421b26b40, 0xc421b59290, 0xc421b58b40)
    /home/jnml/go/src/cmd/compile/internal/gc/esc.go:656 +0x28a
cmd/compile/internal/gc.esclist(0xc421b26b40, 0xc4208eeb00, 0xc421b58b40)
    /home/jnml/go/src/cmd/compile/internal/gc/esc.go:602 +0x68
cmd/compile/internal/gc.escfunc(0xc421b26b40, 0xc421b58b40)
    /home/jnml/go/src/cmd/compile/internal/gc/esc.go:544 +0x1b6
cmd/compile/internal/gc.escAnalyze(0xc421ab64e0, 0x1, 0x1, 0x0)
    /home/jnml/go/src/cmd/compile/internal/gc/esc.go:467 +0x4a2
cmd/compile/internal/gc.genwrapper(0xc4207bf900, 0xc420fbbf80, 0xc420ad9f10, 0x1)
    /home/jnml/go/src/cmd/compile/internal/gc/subr.go:1907 +0xa42
cmd/compile/internal/gc.methods(0xc4207bf900, 0x2e3c8c9a, 0x4, 0x14)
    /home/jnml/go/src/cmd/compile/internal/gc/reflect.go:351 +0x608
cmd/compile/internal/gc.uncommonSize(0xc4207bf900, 0x10)
    /home/jnml/go/src/cmd/compile/internal/gc/reflect.go:75 +0x47
cmd/compile/internal/gc.dcommontype(0xc420c401c0, 0x14, 0xc4207bf900, 0x9)
    /home/jnml/go/src/cmd/compile/internal/gc/reflect.go:854 +0x1f6
cmd/compile/internal/gc.dtypesym(0xc4207bf900, 0xc4207bf900)
    /home/jnml/go/src/cmd/compile/internal/gc/reflect.go:1280 +0xd6b
cmd/compile/internal/gc.dcommontype(0xc420c4a150, 0x0, 0xc420f79cc0, 0x0)
    /home/jnml/go/src/cmd/compile/internal/gc/reflect.go:823 +0xaad
cmd/compile/internal/gc.dtypesym(0xc420f79cc0, 0xc420f37180)
    /home/jnml/go/src/cmd/compile/internal/gc/reflect.go:1149 +0xc2b
cmd/compile/internal/gc.dtypesym(0xc420f79720, 0xc420f79720)
    /home/jnml/go/src/cmd/compile/internal/gc/reflect.go:1290 +0xe91
cmd/compile/internal/gc.dtypesym(0xc420f79e00, 0xc420f6b500)
    /home/jnml/go/src/cmd/compile/internal/gc/reflect.go:1278 +0xd37
cmd/compile/internal/gc.dtypesym(0xc420f79680, 0xc42139e000)
    /home/jnml/go/src/cmd/compile/internal/gc/reflect.go:1290 +0xe91
cmd/compile/internal/gc.dumptypestructs()
    /home/jnml/go/src/cmd/compile/internal/gc/reflect.go:1363 +0xcc
cmd/compile/internal/gc.dumpobj1(0x7ffcbac9f045, 0x44, 0x3)
    /home/jnml/go/src/cmd/compile/internal/gc/obj.go:133 +0x553
cmd/compile/internal/gc.dumpobj()
    /home/jnml/go/src/cmd/compile/internal/gc/obj.go:45 +0x52
cmd/compile/internal/gc.Main()
    /home/jnml/go/src/cmd/compile/internal/gc/main.go:488 +0x1a56
cmd/compile/internal/amd64.Main()
    /home/jnml/go/src/cmd/compile/internal/amd64/galign.go:93 +0x2fa
main.main()
    /home/jnml/go/src/cmd/compile/main.go:33 +0x2a3

FAIL    github.com/cznic/y [build failed]
jnml@4670:~/src/github.com/cznic/y$ 

The issue is specific to go1.7beta1, no problem with stable (go1.6.1).

@josharian
Copy link
Contributor

Bisect points to 4a7aba7 (CL 21233). Maybe namedAuto is creating malformed Nodes/Types? cc @randall77

@josharian josharian added this to the Go1.7 milestone Jun 5, 2016
@randall77
Copy link
Contributor

Seems like using the name len as a method name triggers the bug. I'll see if I can make a fix tomorrow.

@randall77 randall77 self-assigned this Jun 5, 2016
@josharian
Copy link
Contributor

josharian commented Jun 5, 2016

Makes sense—there's then an ambiguity about what x.len is. Fix might be as simple as changing +".len" to +"..len" in SplitSlice, and mutatis mutandis for the other suffixes in that CL.

@josharian
Copy link
Contributor

Did a quick check and that fix works. I didn't have any luck distilling a small, simple, standalone test, though, which is why I haven't mailed a CL. Keith, do you still plan to fix this, or should I work harder at extracting a test case?

@randall77
Copy link
Contributor

I have a CL at https://go-review.googlesource.com/#/c/23789/ . I didn't mess with the names, just made a fake package for the autos so they don't interfere.
Still needs a test. I'll try to get one together tonight.

@gopherbot
Copy link

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

@golang golang locked and limited conversation to collaborators Jun 7, 2017
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

4 participants