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: reject plugins built with a different version of the toolchain #17832

Closed
ianlancetaylor opened this issue Nov 7, 2016 · 9 comments
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@ianlancetaylor
Copy link
Contributor

We should explicitly reject an attempt to open a plugin that was created by a different version of the Go toolchain. We have no reliable way to make that work, as the internal runtime package interface changes between versions. (I didn't see an explicit check for this--I may have missed one.)

@ianlancetaylor ianlancetaylor added this to the Go1.8 milestone Nov 7, 2016
@quentinmit quentinmit added the NeedsFix The path to resolution is known, but the work has not been done. label Nov 7, 2016
@gopherbot
Copy link

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

@wendigo
Copy link

wendigo commented Nov 14, 2016

Hi,

I've cherry picked this change and built tip and now every time I get mismatch for the "runtime" package on macOS: could not open plugin: plugin.Open: plugin was built with a different version of package runtime

@crawshaw
Copy link
Member

What version of macOS?
Are you seeing that output from all.bash?

@wendigo
Copy link

wendigo commented Nov 15, 2016

Ok, I've been able to distill minimal reproducible test from my case.

It turns out that plugin fails to load when loaded via go test with an error: plugin.Open: plugin was built with a different version of package runtime.

I've created repository https://github.com/wendigo/go-plugin-33161 showing this behaviour.

Hope this helps :)

@wendigo
Copy link

wendigo commented Nov 15, 2016

Updating yesterday comment: I've tested it on newest tip version (b687d6a) with cherry-picked change #33161. ./all.bash is ok (no failing tests).

macOS version is OS X 10.11.6

~ go version
go version devel +9d63294 Tue Nov 15 11:31:54 2016 +0100 darwin/amd64

~ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/mateusz.gajewski/Desktop/Projects/"
GORACE=""
GOROOT="/Users/mateusz.gajewski/Desktop/go"
GOTOOLDIR="/Users/mateusz.gajewski/Desktop/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/43/1y0rrqr55zq3f8cj5wpkt1kmhc7r33/T/go-build349051862=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
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"

@crawshaw
Copy link
Member

I believe in-package tests are a particularly gnarly corner-case, and so I've punted it to #17928. (I don't believe that needs to be fixed for 1.8.)

@quentinmit
Copy link
Contributor

@crawshaw The fix for this seems to have caused the linux-amd64-noopt builder to start failing. Can you please take a look?

@quentinmit quentinmit reopened this Nov 16, 2016
@crawshaw
Copy link
Member

Can't we handle this on the new bug we have for this: #17937?

I'll try to find some time this weekend.

@quentinmit
Copy link
Contributor

Absolutely, I didn't see the new bug. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants