-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.help wanted
Milestone
Description
What version of Go are you using (go version)?
Tested on:
1.11.13 linux/amd641.12.9 linux/amd641.13 linux/amd64
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (go env)?
Inside TravisCI's "xenial" dist. It also reproduces on my local machine.
Details
GOARCH="amd64" GOBIN="" GOCACHE="/home/travis/.cache/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/travis/gopath" GOPROXY="" GORACE="" GOROOT="/home/travis/.gimme/versions/go1.11.13.linux.amd64" GOTMPDIR="" GOTOOLDIR="/home/travis/.gimme/versions/go1.11.13.linux.amd64/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" CXX="g++" 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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build631088280=/tmp/go-build -gno-record-gcc-switches"
What did you do?
git clone https://github.com/vmarkovtsev/hercules -b reproduce-panic
cd hercules && make
./hercules generate-plugin -n MyPlug -o myplug && cd myplug && make
# runs: go build -buildmode=plugin -linkshared my_plug.go my_plug.pb.go
What did you expect to see?
The built my_plug.so.
What did you see instead?
panic: runtime error: slice bounds out of range [:-2]
goroutine 1 [running]:
cmd/go/internal/load.(*Package).load(0xc0002da900, 0xc000299668, 0xc000453180, 0x0, 0x0)
/usr/local/go/src/cmd/go/internal/load/pkg.go:1491 +0x36db
cmd/go/internal/load.loadImport(0x0, 0xc00047d781, 0x1e, 0xc000554f00, 0x38, 0xc0000c3680, 0xc000299668, 0xc0000b80f0, 0x2, 0x2, ...)
/usr/local/go/src/cmd/go/internal/load/pkg.go:511 +0xdf2
cmd/go/internal/load.LoadImport(0xc00047d781, 0x1e, 0xc000554f00, 0x38, 0xc0000c3680, 0xc000299668, 0xc0000b80f0, 0x2, 0x2, 0x1, ...)
/usr/local/go/src/cmd/go/internal/load/pkg.go:464 +0xaa
cmd/go/internal/load.(*Package).load(0xc0000c3680, 0xc000299668, 0xc000088700, 0x0, 0x0)
/usr/local/go/src/cmd/go/internal/load/pkg.go:1605 +0x1993
cmd/go/internal/load.GoFilesPackage(0xc0000b6160, 0x2, 0x2, 0x4d3c01)
/usr/local/go/src/cmd/go/internal/load/pkg.go:2130 +0x543
cmd/go/internal/load.PackagesAndErrors(0xc0000b6160, 0x2, 0x2, 0x0, 0x0, 0x0)
/usr/local/go/src/cmd/go/internal/load/pkg.go:1956 +0x6ca
cmd/go/internal/load.PackagesForBuild(0xc0000b6160, 0x2, 0x2, 0xa3a450, 0x2, 0x1)
/usr/local/go/src/cmd/go/internal/load/pkg.go:2023 +0x5d
cmd/go/internal/work.runBuild(0xea4280, 0xc0000b6160, 0x2, 0x2)
/usr/local/go/src/cmd/go/internal/work/build.go:316 +0x88
main.main()
/usr/local/go/src/cmd/go/main.go:189 +0x57f
Notes
This used to work fine without go modules.
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.help wanted