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: buildmode=shared -linkshared - makeslice: cap out of range #58405

Open
GouthamBanala opened this issue Feb 8, 2023 · 1 comment
Open
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@GouthamBanala
Copy link

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

1.20

$ go version
go version go1.20 linux/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/gbanala/.cache/go-build"
GOENV="/home/gbanala/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/gbanala/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/gbanala/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/gbanala/test/go/test1module/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3140564779=/tmp/go-build -gno-record-gcc-switches"

What did you do?

  1. sudo go install -buildmode=shared std
  2. sudo go install -buildmode=shared -linkshared github.com/aristanetworks/goarista/gnmi

What did you expect to see?

Expect the shared library to be generated

What did you see instead?

/tmp/go-build2293747986/b246/libgithub.com-aristanetworks-goarista-gnmi.so

panic: runtime error: makeslice: cap out of range

goroutine 1 [running]:
cmd/link/internal/loader.(*Loader).LoadSyms(0xc000004300, 0x68a54a?)
/usr/local/go/src/cmd/link/internal/loader/loader.go:2159 +0x11c
cmd/link/internal/ld.(*Link).loadlib(0xc0000fa000)
/usr/local/go/src/cmd/link/internal/ld/lib.go:595 +0x48f
cmd/link/internal/ld.Main(_, {0x20, 0x20, 0x1, 0x7, 0x10, 0x0, {0x0, 0x0}, {0x6946ab, ...}, ...})
/usr/local/go/src/cmd/link/internal/ld/main.go:268 +0xecb
main.main()
/usr/local/go/src/cmd/link/main.go:72 +0xedb

@GouthamBanala GouthamBanala changed the title affected/package: makeslice: cap out of range affected/package: buildmode=shared -linkshared - makeslice: cap out of range Feb 8, 2023
@mengzhuo mengzhuo changed the title affected/package: buildmode=shared -linkshared - makeslice: cap out of range cmd/link: buildmode=shared -linkshared - makeslice: cap out of range Feb 8, 2023
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Feb 8, 2023
@dr2chase dr2chase added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 10, 2023
@mknyszek mknyszek added this to the Backlog milestone Feb 15, 2023
@thanm
Copy link
Contributor

thanm commented Feb 15, 2023

Obsoleted by #47788

See related issues #47183 and #42189 or similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Development

No branches or pull requests

5 participants