go-getting-started icon indicating copy to clipboard operation
go-getting-started copied to clipboard

Linux Local Build results in a runtime error: index out of range [2097386] with length 242

Open CharlesDerek opened this issue 2 years ago • 0 comments

Following the provided instructions page results in this error.

git clone https://github.com/heroku/go-getting-started.git

cd go-getting-started

go version (returns)

go version go1.18.2 linux/amd64

go build -o bin/go-getting-started -v . (returns the following)

github.com/gin-gonic/gin/internal/bytesconv
github.com/go-playground/locales/currency
google.golang.org/protobuf/internal/flags
google.golang.org/protobuf/internal/set
golang.org/x/sys/internal/unsafeheader
google.golang.org/protobuf/internal/pragma
github.com/go-playground/locales
golang.org/x/crypto/sha3
google.golang.org/protobuf/internal/detrand
github.com/gin-gonic/gin/internal/json
google.golang.org/protobuf/internal/version
github.com/leodido/go-urn
golang.org/x/sys/unix
gopkg.in/yaml.v2
github.com/heroku/x/hmetrics
github.com/gin-contrib/sse
github.com/ugorji/go/codec
github.com/go-playground/universal-translator
google.golang.org/protobuf/internal/errors
google.golang.org/protobuf/encoding/protowire
github.com/heroku/x/hmetrics/onload
google.golang.org/protobuf/reflect/protoreflect
github.com/go-playground/validator/v10
google.golang.org/protobuf/internal/strs
google.golang.org/protobuf/internal/order
google.golang.org/protobuf/internal/encoding/messageset
google.golang.org/protobuf/internal/genid
google.golang.org/protobuf/runtime/protoiface
google.golang.org/protobuf/internal/descopts
google.golang.org/protobuf/internal/descfmt
google.golang.org/protobuf/reflect/protoregistry
google.golang.org/protobuf/internal/encoding/text
google.golang.org/protobuf/proto
github.com/mattn/go-isatty
google.golang.org/protobuf/internal/encoding/defval
google.golang.org/protobuf/encoding/prototext
google.golang.org/protobuf/internal/filedesc
google.golang.org/protobuf/internal/encoding/tag
google.golang.org/protobuf/internal/impl
google.golang.org/protobuf/internal/filetype
google.golang.org/protobuf/runtime/protoimpl
google.golang.org/protobuf/types/descriptorpb
google.golang.org/protobuf/reflect/protodesc
github.com/golang/protobuf/proto
github.com/gin-gonic/gin/binding
github.com/gin-gonic/gin/render
github.com/gin-gonic/gin
github.com/heroku/go-getting-started
# github.com/heroku/go-getting-started
panic: runtime error: index out of range [2097386] with length 242

goroutine 1 [running]:
cmd/link/internal/loader.(*Loader).resolve(0x1720?, 0xc000afec00?, {0x512000?, 0xc0?})
	/usr/lib/go-1.18/src/cmd/link/internal/loader/loader.go:659 +0x1c5
cmd/link/internal/loader.Reloc.Sym({0x7f583c73e06e?, 0xc000afec00?, 0xc000512000?})
	/usr/lib/go-1.18/src/cmd/link/internal/loader/loader.go:59 +0x35
cmd/link/internal/loader.(*Loader).UndefinedRelocTargets(0xc000512000, 0x1)
	/usr/lib/go-1.18/src/cmd/link/internal/loader/loader.go:2465 +0x1a5
cmd/link/internal/ld.(*Link).loadlib(0xc000116000)
	/usr/lib/go-1.18/src/cmd/link/internal/ld/lib.go:600 +0x5d7
cmd/link/internal/ld.Main(_, {0x20, 0x20, 0x1, 0x7, 0x10, 0x0, {0x0, 0x0}, {0x67f58a, ...}, ...})
	/usr/lib/go-1.18/src/cmd/link/internal/ld/main.go:261 +0xe2b
main.main()
	/usr/lib/go-1.18/src/cmd/link/main.go:69 +0xfe5

From what I understand this error means that the compiler is trying to access an index (2097386) that is out of range (242).

Not exactly sure which int value to fix, or if even changing a specific int value will fix the issue considering there are 790 files.

I also noted the path ./vendor/ has no github.com/heroku/go-getting-started file or directory. This could also be the point of failure.

CharlesDerek avatar Jun 11 '22 18:06 CharlesDerek