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: slice bounds out of range #15448

Closed
crawshaw opened this issue Apr 26, 2016 · 1 comment

Comments

Projects
None yet
3 participants
@crawshaw
Copy link
Contributor

commented Apr 26, 2016

At tip, this program does not link:

package main

import "words_words_words"

var M map[words_words_words.WordWord]struct {
    possibleFirstWord          words_words_words.WordWord
    wordsAndWords              int32
    initiatingAbWord           words_words_words.AbWord
    isWordsWordsWords          bool
    cancelWordToWord           bool
    isWordWordWordWordWordWord bool
    isWordWordWord             bool
}

var I interface{}

func main() {
    I = M
}

Where package words_words_words is defined as:

package words_words_words

type WordWord int32

type AbWord int32

The linker panics:

panic: runtime error: slice bounds out of range

goroutine 52 [running]:
panic(0x184760, 0xc820012140)
    /Users/crawshaw/go/src/runtime/panic.go:500 +0x18c
cmd/link/internal/ld.decodetype_str(0xc820500380, 0xc820d4200b, 0x3)
    /Users/crawshaw/go/src/cmd/link/internal/ld/decodesym.go:229 +0xad
cmd/link/internal/ld.dodataSect(0x13, 0xc820ca8000, 0x1b7, 0x1b7, 0x0, 0x0, 0x0, 0x0)
    /Users/crawshaw/go/src/cmd/link/internal/ld/data.go:1835 +0x1c7
cmd/link/internal/ld.dodata.func1(0xc820c90000, 0x13, 0xc8206c6a20, 0xc820b8fc30)
    /Users/crawshaw/go/src/cmd/link/internal/ld/data.go:1318 +0x63
created by cmd/link/internal/ld.dodata
    /Users/crawshaw/go/src/cmd/link/internal/ld/data.go:1320 +0x6bb

@crawshaw crawshaw self-assigned this Apr 26, 2016

@crawshaw crawshaw added this to the Go1.7 milestone Apr 26, 2016

@robpike

This comment has been minimized.

Copy link
Contributor

commented Apr 26, 2016

That's a lot of words.

@gopherbot gopherbot closed this in 96b8f70 Apr 26, 2016

@golang golang locked and limited conversation to collaborators Apr 26, 2017

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.