Skip to content

plugin: go plugin doesn't work on linux/arm64 #24940

Closed
@hufengwei

Description

@hufengwei

Please answer these questions before submitting your issue. Thanks!

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

go version go1.8.3 linux/arm64

Does this issue reproduce with the latest release?

Yes

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

GOARCH="arm64"
GOBIN=""
GOEXE=""
GOHOSTARCH="arm64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/go"
GORACE=""
GOROOT="/usr/lib/golang"
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_arm64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build100800721=/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?

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

I use "go build -v -o demo.so -buildmode=plugin demo.go" to build go plugin demo.so.
Then I use "plugin.Open(/path/to/demo.so)" to open the plugin in the run-time.

What did you expect to see?

The plugin demo.so could successfully be loaded into process and run.

What did you see instead?

My process got panic. Please see the call stack as below:

==========================================================
fatal error: runtime: no plugin module data

goroutine 1 [running]:
runtime.throw(0xaac21a, 0x1e)
/usr/lib/golang/src/runtime/panic.go:596 +0x70 fp=0x4420181650 sp=0x4420181630
plugin.lastmoduleinit(0x23b17720, 0x442000e0c8, 0x23b18800, 0x45, 0xd41260)
/usr/lib/golang/src/runtime/plugin.go:13 +0x9bc fp=0x4420181780 sp=0x4420181650
plugin.open(0x4420078d70, 0x46, 0x0, 0x0, 0x0)
/usr/lib/golang/src/plugin/plugin_dlopen.go:72 +0x1d0 fp=0x44201819c0 sp=0x4420181780
plugin.Open(0x4420078d70, 0x46, 0x4420012e80, 0x3, 0x4)
/usr/lib/golang/src/plugin/plugin.go:30 +0x28 fp=0x44201819f0 sp=0x44201819c0

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions