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/link: panic during go test on tip #14783

peterbourgon opened this issue Mar 11, 2016 · 5 comments

cmd/link: panic during go test on tip #14783

peterbourgon opened this issue Mar 11, 2016 · 5 comments


Copy link

@peterbourgon peterbourgon commented Mar 11, 2016

Please answer these questions before submitting your issue. Thanks!

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

go version devel +de4317c

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


  1. What did you do?
    If possible, provide a recipe for reproducing the error.
    A complete runnable program is good.
    A link on is best.

Travis CI ran the tests for my project, here is the job:

  1. What did you expect to see?

Tests pass.

  1. What did you see instead?
# testmain
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0xf0 pc=0x4bd077]
goroutine 1 [running]:
panic(0x5a4c40, 0xc820018180)
    /home/travis/.gimme/versions/go/src/runtime/panic.go:500 +0x189
cmd/link/internal/ld.decodetype_funcincount(0x0, 0x28)
    /home/travis/.gimme/versions/go/src/cmd/link/internal/ld/decodesym.go:182 +0x27
cmd/link/internal/ld.decode_methodsig(0xc82119fad0, 0x40070, 0x30, 0x1, 0x1, 0x0, 0x4)
    /home/travis/.gimme/versions/go/src/cmd/link/internal/ld/decodesym.go:281 +0x121
cmd/link/internal/ld.decodetype_methods(0xc82119fad0, 0x0, 0x0, 0x0)
    /home/travis/.gimme/versions/go/src/cmd/link/internal/ld/decodesym.go:355 +0x169
    /home/travis/.gimme/versions/go/src/cmd/link/internal/ld/deadcode.go:296 +0xd50
    /home/travis/.gimme/versions/go/src/cmd/link/internal/ld/deadcode.go:56 +0xc5
    /home/travis/.gimme/versions/go/src/cmd/link/internal/ld/pobj.go:190 +0x1349
    /home/travis/.gimme/versions/go/src/cmd/link/internal/amd64/obj.go:44 +0x19
    /home/travis/.gimme/versions/go/src/cmd/link/main.go:27 +0x27c

The build output is a little confusing, mea culpa. It looks like the test that triggers this panic is from package kit/log, you can find that by searching that page for "build failed".

@bradfitz bradfitz changed the title linker panic during go test on tip cmd/link: panic during go test on tip Mar 11, 2016
@bradfitz bradfitz added this to the Go1.7Early milestone Mar 11, 2016
Copy link

@crawshaw crawshaw commented Mar 11, 2016

Is there something I can go get to reproduce this?

Copy link

@dgryski dgryski commented Mar 11, 2016

go get -v -u

Copy link

@davecheney davecheney commented Mar 11, 2016

Thanks for the report. This looks like the *Lsym that decode_funcincount is trying to read into can be nil in some circumstances.

func decode_reloc_sym(s *LSym, off int32) *LSym {
    r := decode_reloc(s, off)
    if r == nil {
        return nil
    return r.Sym
Copy link

@crawshaw crawshaw commented Mar 11, 2016


package main                                                                    

var three = 3                                                                   

type CustomT func(...interface{}) error                                         

func (f CustomT) M() {                                                          
        if 4 < three {                                                          

func main() {                                                                   
        var v CustomT                                                           

I believe I understand the cause and will get a CL out soon.

Copy link

@gopherbot gopherbot commented Mar 11, 2016

CL mentions this issue.

@gopherbot gopherbot closed this in 7c54656 Mar 12, 2016
@golang golang locked and limited conversation to collaborators Mar 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.