Skip to content

cgo argument has Go pointer to Go pointer #25

Description

@aep

the example straight from README.md doesnt work.

$ ./derp 
panic: runtime error: cgo argument has Go pointer to Go pointer

goroutine 1 [running]:
github.com/qiniu/py.(*Closure).NewFunction.func2(0xc420020120, 0x2, 0x2645d50)
	/home/aep/ai/makepage/.workspace/src/github.com/qiniu/py/gofunction.go:25 +0x52
github.com/qiniu/py.(*Closure).NewFunction(0xc4200200f0, 0xc4200102a1, 0x7, 0x2, 0x0, 0x0, 0x0)
	/home/aep/ai/makepage/.workspace/src/github.com/qiniu/py/gofunction.go:25 +0xb7
github.com/qiniu/py.Register(0x7f4a8bddfd70, 0xc42004fe18, 0x4, 0x4f2380, 0x7c93c8, 0xc42004fe18, 0x4, 0xc4200102d0)
	/home/aep/ai/makepage/.workspace/src/github.com/qiniu/py/goregister.go:64 +0x4a5
github.com/qiniu/py.NewGoModule(0x50eaea, 0x3, 0x0, 0x0, 0x4f2380, 0x7c93c8, 0x7f4a8bde66e0, 0x0, 0x0, 0x0, ...)
	/home/aep/ai/makepage/.workspace/src/github.com/qiniu/py/gomodule.go:33 +0x1bf
main.main()
	/home/aep/ai/makepage/.workspace/src/derp/main.go:46 +0x83
$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/aep/gocode"
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-build102676572=/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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions