Skip to content

cmd/compile: internal compiler error: debuginfo unused node #22962

@ALTree

Description

@ALTree
$ gotip version
go version devel +9372166faa Fri Dec 1 18:52:50 2017 +0000 linux/amd64

The following two-files program:

a/a.go

package a

func F() {
	if x := 0; false {
		_ = x
	}
}

b/b.go

package b

import "a"

var V = func() { a.F() }

crashes the tip compiler (when compiling b) with the following error message:

# command-line-arguments
<autogenerated>:1:0: internal compiler error: debuginfo unused node (AllocFrame should truncate fn.Func.Dcl)

goroutine 1 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
	/home/alberto/go/src/runtime/debug/stack.go:24 +0xa7
cmd/compile/internal/gc.Fatalf(0xc29ce4, 0x3e, 0x0, 0x0, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/subr.go:182 +0x1f2
cmd/compile/internal/gc.debuginfo(0xc420306150, 0xc04bc0, 0xc4203501e0, 0x30, 0xc4203135c8, 0x41da36, 0xc4204ac480, 0x7f4aead3c011, 0x7f4aeaf4c610)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:325 +0x448
cmd/internal/obj.(*Link).DwarfAbstractFunc(0xc42000e240, 0xc04bc0, 0xc4203501e0, 0xc420306150, 0x7ffca3d38266, 0x16)
	/home/alberto/go/src/cmd/internal/obj/objfile.go:603 +0xb9
cmd/compile/internal/gc.genAbstractFunc(0xc420306150)
	/home/alberto/go/src/cmd/compile/internal/gc/dwinl.go:167 +0xb0
cmd/internal/obj.(*DwarfFixupTable).Finalize(0xc420059080, 0x7ffca3d38266, 0x16, 0xc42000e400)
	/home/alberto/go/src/cmd/internal/obj/objfile.go:854 +0x266
cmd/compile/internal/gc.Main(0xc2d428)
	/home/alberto/go/src/cmd/compile/internal/gc/main.go:655 +0x2cd1
main.main()
	/home/alberto/go/src/cmd/compile/main.go:49 +0x89

The compiler does not crash if -gendwarfinl=0 is passed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions