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: panic: First time we've seen filename (part II) #35652

ALTree opened this issue Nov 17, 2019 · 2 comments

cmd/compile: panic: First time we've seen filename (part II) #35652

ALTree opened this issue Nov 17, 2019 · 2 comments


Copy link

@ALTree ALTree commented Nov 17, 2019

$ gotip version
go version devel +6ba0be1639 Sat Nov 16 20:31:45 2019 +0000 linux/amd64

The following code (minimized from a gosmith-generated program):

package p

func f() {
	for true {
		if true {

crashes the tip compiler with this error:

$ gotip build crash.go 

# command-line-arguments
panic: First time we've seen filename: "gofile..??"

goroutine 49 [running]:
cmd/internal/obj.(*Link).generateDebugLinesSymbol(0xc000378ea0, 0xc000553d00, 0xc000553f00)
	/home/alberto/go/src/cmd/internal/obj/dwarf.go:43 +0x8e3
cmd/internal/obj.(*Link).populateDWARF(0xc000378ea0, 0xe40dc0, 0xc000166160, 0xc000553d00, 0x7fff3ca56300, 0x16)
	/home/alberto/go/src/cmd/internal/obj/objfile.go:619 +0x31c
cmd/internal/obj.Flushplist(0xc000378ea0, 0xc00058bea8, 0xc000048250, 0x7fff3ca56300, 0x16)
	/home/alberto/go/src/cmd/internal/obj/plist.go:112 +0x7d8
	/home/alberto/go/src/cmd/compile/internal/gc/gsubr.go:94 +0xbc
cmd/compile/internal/gc.compileSSA(0xc000166160, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:323 +0x690
cmd/compile/internal/gc.compileFunctions.func2(0xc000554d20, 0xc0005560f0, 0x0)
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:363 +0x49
created by cmd/compile/internal/gc.compileFunctions
	/home/alberto/go/src/cmd/compile/internal/gc/pgen.go:361 +0x128

It compiles fine on Go1.13.4.

This appears to be related to the compiler crash previously reported in #34520.

cc @cherrymui @aclements @randall77

@ALTree ALTree added this to the Go1.14 milestone Nov 17, 2019
@dr2chase dr2chase self-assigned this Nov 18, 2019

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 18, 2019

Change mentions this issue: cmd/compile: make a better bogus line for empty infinite loops


This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 19, 2019

Change mentions this issue: cmd/compile: try harder to not use an empty src.XPos for a bogus line

gopherbot pushed a commit that referenced this issue Nov 22, 2019
The fix for #35652 did not guarantee that it was using a non-empty
src position to replace an empty one.  The new code checks again
and falls back to a more certain position.  (The input in question
compiles to a single empty infinite loop, and none of the actual instructions
had any source position at all.  That is a bug, but given the pathology
of this input, not one worth dealing with this late in the release cycle,
if ever.)


00000 (5) TEXT "".f(SB), ABIInternal
00001 (5) PCDATA $0, $-2
00002 (5) PCDATA $1, $-2
00003 (5) FUNCDATA $0, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
00004 (5) FUNCDATA $1, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
00005 (5) FUNCDATA $2, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
00006 (?) XCHGL AX, AX
00007 (+1048575) JMP 6
00008 (?) END

TODO: Add runtime.InfiniteLoop(), replace infinite loops with a call to
that, and use an eco-friendly runtime.gopark instead.  (This was Cherry's
excellent idea.)

Updates #35652
Fixes #35695

Change-Id: I4b9a841142ee4df0f6b10863cfa0721a7e13b437
Run-TryBot: David Chase <>
TryBot-Result: Gobot Gobot <>
Reviewed-by: Cherry Zhang <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.