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 during deadcode pass #17729

Closed
ainar-g opened this issue Nov 1, 2016 · 1 comment
Closed

cmd/link: panic during deadcode pass #17729

ainar-g opened this issue Nov 1, 2016 · 1 comment

Comments

@ainar-g
Copy link
Contributor

ainar-g commented Nov 1, 2016

What did you do?

https://play.golang.org/p/nY266bkAfK

Compiling with

go build -buildmode plugin plugin.go

What did you expect to see?

Successful compilation.

What did you see instead?

# command-line-arguments
panic: runtime error: index out of range

goroutine 1 [running]:
panic(0x5adb20, 0x69d9e0)
	/home/ainar/go/gotip/src/runtime/panic.go:531 +0x1cf
cmd/link/internal/ld.(*deadcodepass).flood(0xc42006bd30)
	/home/ainar/go/gotip/src/cmd/link/internal/ld/deadcode.go:293 +0xddf
cmd/link/internal/ld.deadcode(0xc42000e750)
	/home/ainar/go/gotip/src/cmd/link/internal/ld/deadcode.go:62 +0xdb
cmd/link/internal/ld.Main()
	/home/ainar/go/gotip/src/cmd/link/internal/ld/main.go:185 +0x811
main.main()
	/home/ainar/go/gotip/src/cmd/link/main.go:55 +0x139

Does this issue reproduce with the latest release (go1.7.3)?

-buildmode=plugin is Go 1.8+, IIRC.

System details

go version devel +689947d Tue Nov 1 23:06:24 2016 +0000 linux/amd64
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/ainar/go"
GORACE=""
GOROOT="/home/ainar/go/gotip"
GOTOOLDIR="/home/ainar/go/gotip/pkg/tool/linux_amd64"
TERM="dumb"
GCCGO="/home/ainar/go/bin/gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build842240689=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
uname -sr: Linux 4.4.0-45-generic
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.1 LTS
Release:	16.04
Codename:	xenial
/lib/x86_64-linux-gnu/libc.so.6: GNU C Library (Ubuntu GLIBC 2.23-0ubuntu4) stable release version 2.23, by Roland McGrath et al.
gdb --version: GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
@ianlancetaylor
Copy link
Contributor

Dup of #17140.

@golang golang locked and limited conversation to collaborators Nov 1, 2017
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

3 participants