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: init functions aren't run if plugin directory contains a dot character #23695

Closed
Dirbaio opened this issue Feb 5, 2018 · 3 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@Dirbaio
Copy link

Dirbaio commented Feb 5, 2018

Init functions are not run when Open()-ing a plugin that has been compiled from a directory containing a dot in its name.

How to reproduce:

  • Clone https://github.com/Dirbaio/pluginbug into the right folder in your gopath
  • Run go run ./plugin.v1/main.go. You get The int is: 42, as expected
  • Compile the plugin: go build -buildmode=plugin -o plugin.so ./plugin.v1/
  • Run the plugin host: go run host/main.go. You get The int is: 0, because the init function hasn't run.
  • Rename plugin.v1 to pluginv1, and everything works.
dirbaio@saturn:~$ go version
go version go1.9.3 linux/amd64
dirbaio@saturn:~$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/dirbaio/go"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build594308222=/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"
@mvdan mvdan added this to the Go1.11 milestone Feb 5, 2018
@mvdan mvdan added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 5, 2018
@0xmohit
Copy link
Contributor

0xmohit commented Feb 5, 2018

This cannot be reproduced on tip. Likely fixed in 6355d6c.

@mvdan
Copy link
Member

mvdan commented Feb 5, 2018

@Dirbaio could you please confirm that this is fixed on tip or on the latest RC for you?

@Dirbaio
Copy link
Author

Dirbaio commented Feb 8, 2018

Just checked 1.10rc1, and it's fixed!

Thanks guys!

@Dirbaio Dirbaio closed this as completed Feb 8, 2018
@golang golang locked and limited conversation to collaborators Feb 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants