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 error: type recorded as live on entry #15176

Closed
bep opened this issue Apr 7, 2016 · 7 comments
Closed

cmd/compile: internal error: type recorded as live on entry #15176

bep opened this issue Apr 7, 2016 · 7 comments
Milestone

Comments

@bep
Copy link
Contributor

bep commented Apr 7, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?

Go tip.

  1. What operating system and processor architecture are you using (go env)?

OS X and Linux on Travis

  1. What did you do?

Build Hugo (https://github.com/spf13/hugo).

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

See https://travis-ci.org/spf13/hugo/builds/121437210

  1. What did you expect to see?

All green.

  1. What did you see instead?

Build fails on Go tip, both OS X and Linux.

I tried to see if this is a duplicate of an already reported issue, but it's hard to tell.

There is a test failure that I haven't looked into, but then there are these build failures:

19.35s$ go build -race

# github.com/pkg/sftp

../../pkg/sftp/client.go:829: internal error: (*File).WriteTo autotmp_781 (type *[]byte) recorded as live on entry, p.Pc=10248

# github.com/russross/blackfriday

../../russross/blackfriday/html.go:932: internal error: (*Html).ensureUniqueHeaderID autotmp_747 (type *int) recorded as live on entry, p.Pc=15486

Not sure when these failures started to happen ...

@dr2chase
Copy link
Contributor

dr2chase commented Apr 7, 2016

Reproduces for me:

go get -u -v github.com/spf13/hugo
cd $GOPATH/src/github.com/spf13/hugo
go build -race -o hugo main.go

@bradfitz bradfitz changed the title Internal error: type recorded as live on entry cmd/compile: internal error: type recorded as live on entry Apr 7, 2016
@bradfitz bradfitz added this to the Go1.7 milestone Apr 7, 2016
@dr2chase
Copy link
Contributor

dr2chase commented Apr 7, 2016

Closer to root cause, in ssa.go I added this test and it fired:

func (s *state) resolveFwdRef(v *ssa.Value) {
    b := v.Block
    name := v.Aux.(*Node)
    v.Aux = nil
    if b == s.f.Entry {
        // Live variable at start of function.
        if s.canSSA(name) {
            if strings.HasPrefix(name.Sym.Name, "autotmp_") {
                s.Fatalf("Treating auto as if it were arg, func %s, node %v, value %v", b.Func.Name, name, v)
            }
            v.Op = ssa.OpArg
            v.Aux = name
            return
        }

@dr2chase
Copy link
Contributor

dr2chase commented Apr 7, 2016

Bad code inserted by racewalk, not sure of the details, but the error (access to uninitialized autotmp) appears after racewalk.

@josharian
Copy link
Contributor

Possible duplicate of #15091.

@dr2chase
Copy link
Contributor

dr2chase commented Apr 8, 2016

Is duplicate, and #15091 has a nice test case.

@dr2chase dr2chase closed this as completed Apr 8, 2016
@dr2chase
Copy link
Contributor

dr2chase commented Apr 8, 2016

FYI, 15091 is fixed now, so this one should also be fixed. Not sure I did this the proper github way, but figured you'd like to know.

@bep
Copy link
Contributor Author

bep commented Apr 8, 2016

Thanks, I guess I would have known either way -- as I just watched the red tests go green on all Go versions. Thanks!

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

5 participants