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: loading plugin fails when dot in package path. #19534

Closed
perrito666 opened this issue Mar 13, 2017 · 4 comments
Closed

plugin: loading plugin fails when dot in package path. #19534

perrito666 opened this issue Mar 13, 2017 · 4 comments

Comments

@perrito666
Copy link

Please answer these questions before submitting your issue. Thanks!

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

go version go1.8 linux/amd64

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/hduran/environments/blogposts"
GORACE=""
GOROOT="/home/hduran/.local/share/goworkon/installs/1.8/go"
GOTOOLDIR="/home/hduran/.local/share/goworkon/installs/1.8/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build353851757=/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"

What did you do?

For a basic example of this:

  • I created a project (repo below)
  • Copied the example from plugin docs (https://golang.org/pkg/plugin/#Plugin.Lookup)
  • Placed one copy of the plugin code in folder v0.1 and another in v01
  • built both.
  • The one from v01 works as expected
  • The one in v0.1 fails with:
panic: plugin.Open(./v01/v0.1.so): realpath failed

goroutine 1 [running]:
main.main()
	/home/hduran/environments/blogposts/src/github.com/perrito666/bug_poc/main.go:9 +0x3a9
  • If the .so file is copied to the same folder and loaded from there, the error changes to:
panic: plugin.Open: could not find symbol F: /home/hduran/environments/blogposts/src/github.com/perrito666/bug_poc/v0.1.so: undefined symbol: github.com/perrito666/bug_poc/v0.1.F

goroutine 1 [running]:
main.main()
	/home/hduran/environments/blogposts/src/github.com/perrito666/bug_poc/main.go:9 +0x3a9
exit status 2

What did you expect to see?

The plugin loading despite the path of its compiled version

What did you see instead?

The aforementioned panics.

@bradfitz bradfitz added this to the Go1.9Maybe milestone Mar 21, 2017
@tzneal
Copy link
Member

tzneal commented Apr 20, 2017

Not sure why this wasn't linked to https://golang.org/cl/40994/

@gopherbot
Copy link

CL https://golang.org/cl/40994 mentions this issue.

@bradfitz
Copy link
Contributor

@tzneal, because of a bug of mine in the new version of gopherbot. Fixed.

@tzneal
Copy link
Member

tzneal commented Apr 21, 2017

@bradfitz, Thanks!

@golang golang locked and limited conversation to collaborators Apr 26, 2018
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

5 participants