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 in deadcode flood #16887

Closed
wangkechun opened this issue Aug 26, 2016 · 7 comments

Comments

Projects
None yet
9 participants
@wangkechun
Copy link

commented Aug 26, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go version go1.7 darwin/amd64
  2. What operating system and processor architecture are you using (go env)?
    GOARCH="amd64"
    GOBIN=""
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="darwin"
    GOOS="darwin"
    GOPATH="/Users/wkc"
    GORACE=""
    GOROOT="/Users/wkc/local/go"
    GOTOOLDIR="/Users/wkc/local/go/pkg/tool/darwin_amd64"
    CC="clang"
    GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/xw/mx32d21j5hd_1gyxv14c77m00000gn/T/go-build713088348=/tmp/go-build -gno-record-gcc-switches -fno-common"
    CXX="clang++"
    CGO_ENABLED="1"
  3. What did you do?
    If possible, provide a recipe for reproducing the error.
    A complete runnable program is good.
    A link on play.golang.org is best.
go install my-package
panic: runtime error: index out of range

goroutine 1 [running]:
panic(0x19fa40, 0xc420012190)
        /usr/local/go/src/runtime/panic.go:500 +0x1a1
cmd/link/internal/ld.(*deadcodepass).flood(0xc420069cd0)
        /usr/local/go/src/cmd/link/internal/ld/deadcode.go:279 +0xe88
cmd/link/internal/ld.deadcode(0xc4204a2000)
        /usr/local/go/src/cmd/link/internal/ld/deadcode.go:100 +0x498
cmd/link/internal/ld.Ldmain()
        /usr/local/go/src/cmd/link/internal/ld/pobj.go:192 +0x1089
cmd/link/internal/amd64.Main()
        /usr/local/go/src/cmd/link/internal/amd64/obj.go:45 +0x19
main.main()
        /usr/local/go/src/cmd/link/main.go:28 +0x27d
  1. What did you expect to see?
  2. What did you see instead?
@davecheney

This comment has been minimized.

Copy link
Contributor

commented Aug 26, 2016

Is the source of the code you are compiling available so I can try to
reproduce this bug?

On Fri, Aug 26, 2016 at 3:15 PM, wangkechun notifications@github.com
wrote:

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?
go version go1.7 darwin/amd64
2.

What operating system and processor architecture are you using (go env
)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/wkc"
GORACE=""
GOROOT="/Users/wkc/local/go"
GOTOOLDIR="/Users/wkc/local/go/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics
-Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/
folders/xw/mx32d21j5hd_1gyxv14c77m00000gn/T/go-build713088348=/tmp/go-build
-gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
3.

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

go install my package
panic: runtime error: index out of range

goroutine 1 [running]:
panic(0x19fa40, 0xc420012190)
/usr/local/go/src/runtime/panic.go:500 +0x1a1
cmd/link/internal/ld.(*deadcodepass).flood(0xc420069cd0)
/usr/local/go/src/cmd/link/internal/ld/deadcode.go:279 +0xe88
cmd/link/internal/ld.deadcode(0xc4204a2000)
/usr/local/go/src/cmd/link/internal/ld/deadcode.go:100 +0x498
cmd/link/internal/ld.Ldmain()
/usr/local/go/src/cmd/link/internal/ld/pobj.go:192 +0x1089
cmd/link/internal/amd64.Main()
/usr/local/go/src/cmd/link/internal/amd64/obj.go:45 +0x19
main.main()
/usr/local/go/src/cmd/link/main.go:28 +0x27d

What did you expect to see?
2.

What did you see instead?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#16887, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAcA7ZpYZ3Ge0vBHC8PrJxuqUWsp686ks5qjnZmgaJpZM4JtvwW
.

@quentinmit quentinmit changed the title go install panic cmd/go: go install panic Aug 26, 2016

@quentinmit quentinmit added this to the Go1.8 milestone Aug 26, 2016

@josharian josharian changed the title cmd/go: go install panic cmd/link: panic in deadcode flood Aug 26, 2016

@josharian

This comment has been minimized.

Copy link
Contributor

commented Aug 26, 2016

cc @crawshaw -- the panic is probably from decodetypeKind in this line:

            if decodetypeKind(s)&kindMask == kindInterface {
@mandeepbrar

This comment has been minimized.

Copy link

commented Sep 25, 2016

+1. Same error. Trying to build an otherwise working program with go:binary-only-package in official docker.

go version go1.7.1 linux/amd64

go env.

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build035439187=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"

@crawshaw

This comment has been minimized.

Copy link
Contributor

commented Sep 25, 2016

@mandeepbrar want to try out https://golang.org/cl/29692? It's designed to fix #17140 but the diagnostics change may mean you get further into linking before an error.

@mandeepbrar

This comment has been minimized.

Copy link

commented Sep 25, 2016

@crawshaw Seems to go a little further, but an error again

`
panic: runtime error: index out of range

goroutine 1 [running]:
panic(0x59f780, 0x690520)
/home/mandeep/test/go/src/runtime/panic.go:496 +0x1a0
cmd/link/internal/ld.newtype(0xc420494000, 0xc4224ad118, 0xc42ebc3770)
/home/mandeep/test/go/src/cmd/link/internal/ld/dwarf.go:379 +0x3701
cmd/link/internal/ld.defgotype(0xc420494000, 0xc4224ad118, 0x592ac0)
/home/mandeep/test/go/src/cmd/link/internal/ld/dwarf.go:374 +0x1f1
cmd/link/internal/ld.newtype(0xc420494000, 0xc42249ad48, 0xc42eb64700)
/home/mandeep/test/go/src/cmd/link/internal/ld/dwarf.go:425 +0x2e77
cmd/link/internal/ld.defgotype(0xc420494000, 0xc42249ad48, 0x592ac0)
/home/mandeep/test/go/src/cmd/link/internal/ld/dwarf.go:374 +0x1f1
cmd/link/internal/ld.defdwsymb(0xc420494000, 0xc42249ae30, 0xc4224fac00, 0x2f, 0xc42b5ac944, 0x2a76e0, 0xc42249ad48)
/home/mandeep/test/go/src/cmd/link/internal/ld/dwarf.go:846 +0x1ba
cmd/link/internal/ld.genasmsym(0xc420494000, 0x5d87d0)
/home/mandeep/test/go/src/cmd/link/internal/ld/lib.go:1892 +0x643
cmd/link/internal/ld.dwarfgeneratedebugsyms(0xc420494000)
/home/mandeep/test/go/src/cmd/link/internal/ld/dwarf.go:1453 +0x8c1
cmd/link/internal/ld.(*Link).dodata(0xc420494000)
/home/mandeep/test/go/src/cmd/link/internal/ld/data.go:1752 +0x2f4b
cmd/link/internal/ld.Main()
/home/mandeep/test/go/src/cmd/link/internal/ld/main.go:204 +0x907
main.main()
/home/mandeep/test/go/src/cmd/link/main.go:55 +0x139

`

@rsc rsc modified the milestones: Go1.9, Go1.8 Nov 11, 2016

@bradfitz

This comment has been minimized.

Copy link
Member

commented Jun 7, 2017

Does anybody have a repro here?

I'm going to kick to Go1.10 since we don't have one yet.

@bradfitz bradfitz modified the milestones: Go1.10, Go1.9 Jun 7, 2017

@gopherbot

This comment has been minimized.

Copy link

commented Jul 7, 2017

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@gopherbot gopherbot closed this Jul 7, 2017

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