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: Assigning a bogus line to XPos with no file #35695

Closed
ALTree opened this issue Nov 19, 2019 · 1 comment
Closed

cmd/compile: panic: Assigning a bogus line to XPos with no file #35695

ALTree opened this issue Nov 19, 2019 · 1 comment
Assignees
Milestone

Comments

@ALTree
Copy link
Member

@ALTree ALTree commented Nov 19, 2019

$ gotip version
go version devel +8cf5293caa Tue Nov 19 06:10:03 2019 +0000 windows/amd64

The following program:

package p

func g() {}

func f() {
	i := 0
	if true {
		i++
	}
	for true {
		continue
		g()
	}
}

crashes the tip compiler with this error:

$ gotip build crash.go

# command-line-arguments
panic: Assigning a bogus line to XPos with no file will cause mysterious downstream failures.

goroutine 21 [running]:
cmd/internal/src.XPos.WithBogusLine(...)
        D:/users/ZZZZZZ/alberto/other/temp/go/src/cmd/internal/src/xpos.go:76
cmd/compile/internal/gc.genssa(0xc000112420, 0xc000114e70)
        D:/users/ZZZZZZ/alberto/other/temp/go/src/cmd/compile/internal/gc/ssa.go:6047 +0x2f85
cmd/compile/internal/gc.compileSSA(0xc0001122c0, 0x1)
        D:/users/ZZZZZZ/alberto/other/temp/go/src/cmd/compile/internal/gc/pgen.go:308 +0x3ac
cmd/compile/internal/gc.compileFunctions.func2(0xc0003948a0, 0xc00009ea60, 0x1)
        D:/users/ZZZZZZ/alberto/other/temp/go/src/cmd/compile/internal/gc/pgen.go:363 +0x50
created by cmd/compile/internal/gc.compileFunctions
        D:/users/ZZZZZZ/alberto/other/temp/go/src/cmd/compile/internal/gc/pgen.go:361 +0x12f

It compiles fine on Go1.13.4.

This is related to #34520 and #35652; the crash message looks different because it was changed in 9bba63b.

cc @dr2chase

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

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 19, 2019

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

@gopherbot gopherbot closed this in 0e02cfb Nov 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.