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

panic: runtime error: index out of range。 cmd/link/internal/ld.decodetypeKind(...) #51935

Closed
jxhb opened this issue Mar 25, 2022 · 4 comments
Closed

Comments

@jxhb
Copy link

jxhb commented Mar 25, 2022

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

$ go version
go version go1.12.17 darwin/amd64

Does this issue reproduce with the latest release?

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

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/cc/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/cc/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/t3/21_3m2tj3yn846__rrn2nn1c0000gn/T/go-build740490844=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

go build

panic: runtime error: index out of range

goroutine 1 [running]:
cmd/link/internal/ld.decodetypeKind(...)
/usr/local/go/src/cmd/link/internal/ld/decodesym.go:69
cmd/link/internal/ld.newtype(0xc00004e000, 0xc00e722660, 0xc01f5b2f40)
/usr/local/go/src/cmd/link/internal/ld/dwarf.go:423 +0x29e1
cmd/link/internal/ld.defgotype(0xc00004e000, 0xc00e722660, 0x3c)
/usr/local/go/src/cmd/link/internal/ld/dwarf.go:418 +0x1c9
cmd/link/internal/ld.dwarfGenerateDebugInfo(0xc00004e000)
/usr/local/go/src/cmd/link/internal/ld/dwarf.go:1810 +0x8ee
cmd/link/internal/ld.Main(0x1431f20, 0x10, 0x20, 0x1, 0x7, 0x10, 0x1278d61, 0x1b, 0x1275a70, 0x14, ...)
/usr/local/go/src/cmd/link/internal/ld/main.go:211 +0xb95
main.main()
/usr/local/go/src/cmd/link/main.go:65 +0x1d0

// Type.commonType.kind
func decodetypeKind(arch *sys.Arch, s sym.Symbol) uint8 {
return s.P[2
arch.PtrSize+7] & objabi.KindMask // 0x13 / 0x1f
}

What did you expect to see?

go build success

What did you see instead?

panic: runtime error: index out of range

goroutine 1 [running]:
cmd/link/internal/ld.decodetypeKind(...)

@seankhliao
Copy link
Member

go1.12 is no longer supported.

@jxhb
Copy link
Author

jxhb commented Mar 27, 2022

If I want to solve this problem, do I have to upgrade the go version?

@jxhb
Copy link
Author

jxhb commented Mar 27, 2022

go1.12 is no longer supported.

If I want to solve this problem, do I have to upgrade the go version?

@ianlancetaylor
Copy link
Contributor

@jxhb We don't know what the problem is. When we say that Go 1.12 is no longer supported, we mean that we aren't going to investigate problems reported against it. We don't have the time to look into problems with such an old release. That is especially true since most likely our advice would be to update to a supported release anyhow.

So, yes, you should update to a newer version, but, no, we can't promise that that will fix the problem. It probably will, but we don't actually know. Sorry.

@golang golang locked and limited conversation to collaborators Mar 27, 2023
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

4 participants