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: debuginfo unused node #22962

ALTree opened this issue Dec 1, 2017 · 2 comments


None yet
4 participants
Copy link

commented Dec 1, 2017

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

The following two-files program:


package a

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


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
	/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
	/home/alberto/go/src/cmd/compile/internal/gc/main.go:655 +0x2cd1
	/home/alberto/go/src/cmd/compile/main.go:49 +0x89

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

@ALTree ALTree added this to the Go1.10 milestone Dec 1, 2017


This comment has been minimized.

Copy link

commented Dec 1, 2017

I will take a look.
Thanks for the reduced test case.


This comment has been minimized.

Copy link

commented Dec 1, 2017

Change mentions this issue: cmd/compile: fix bug in DWARF inl handling of unused autos

@gopherbot gopherbot closed this in 88c2fb9 Dec 4, 2017

@golang golang locked and limited conversation to collaborators Dec 4, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.