plugin: plugin loading fails if the plugin itself imports the plugin package (even indirectly) #21969
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.9 linux/amd64
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN="/home/bga/Development/go/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/bga/Development/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build198786462=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
What did you do?
I wrote down and ran the plugin example here:
https://golang.org/pkg/plugin/#Symbol
I compiled the plugin code with "go build -buildmode=plugin" then I ran the loader program with "go run".
It worked as expected:
$ go run main.go
Hello, number 7
Then I changed the plugin code from:
To:
Recompiled the plugin and ran the loader program again.
What did you expect to see?
$ go run main.go
Hello, number 7
What did you see instead?
$ go run main.go
panic: plugin.Open: plugin was built with a different version of package plugin
goroutine 1 [running]:
main.main()
/home/bga/Development/go/src/bga-local/plugin2/main.go:10 +0x3bb
exit status 2
The text was updated successfully, but these errors were encountered: