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

plugin #17195

Closed
xoba opened this issue Sep 22, 2016 · 1 comment
Closed

plugin #17195

xoba opened this issue Sep 22, 2016 · 1 comment

Comments

@xoba
Copy link
Contributor

xoba commented Sep 22, 2016

Please answer these questions before submitting your issue. Thanks!

What did you do?

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

add function F2 to src/test/test.go — the standard plugin example https://tip.golang.org/pkg/plugin/#Symbol

package main

// // No C code needed.
import "C"

import "fmt"

var V int

func F2(i *int) {
}

func F() {
    fmt.Printf("Hello, number %d\n", V)
}

then build as go build -buildmode=plugin test

What did you expect to see?

file test.so in cwd.

What did you see instead?

# test
panic: runtime error: index out of range

goroutine 1 [running]:
panic(0x59e760, 0x68e520)
    /root/go/src/runtime/panic.go:496 +0x1a0
cmd/link/internal/ld.(*deadcodepass).flood(0xc420519ce8)
    /root/go/src/cmd/link/internal/ld/deadcode.go:289 +0xdea
cmd/link/internal/ld.deadcode(0xc4204ba000)
    /root/go/src/cmd/link/internal/ld/deadcode.go:60 +0xdb
cmd/link/internal/ld.Main()
    /root/go/src/cmd/link/internal/ld/main.go:185 +0x805
main.main()
    /root/go/src/cmd/link/main.go:55 +0x139

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

n/a

System details

go version devel +dcbbd31 Thu Sep 22 06:41:11 2016 +0000 linux/amd64
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GORACE=""
GOROOT="/home/mra/go"
GOTOOLDIR="/home/mra/go/pkg/tool/linux_amd64"
TERM="dumb"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build514935108=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
uname -sr: Linux 3.13.0-37-generic
Distributor ID: LinuxMint
Description:    Linux Mint 17.1 Rebecca
Release:    17.1
Codename:   rebecca
/lib/x86_64-linux-gnu/libc.so.6: GNU C Library (Ubuntu EGLIBC 2.19-0ubuntu6.9) stable release version 2.19, by Roland McGrath et al.
gdb --version: GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
@crawshaw
Copy link
Member

I believe this is a duplicate of #17140. (Which I intend to fix soon, I've just almost got this all working on darwin/amd64 and want to get that out first.)

@golang golang locked and limited conversation to collaborators Sep 22, 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