goxjs / gl

Go cross-platform OpenGL bindings.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go 1.6 cgocheck

shibukawa opened this issue · comments

golang/go#12416

Go 1.6 will be released end of this month and reject passing go memory block to cgo. Do you have any plant to support 1.6?

panic: runtime error: cgo argument has Go pointer to Go pointer

goroutine 1 [running, locked to thread]:
github.com/go-gl/gl/v2.1/gl.ShaderSource(0x100000002, 0xc82002e088, 0x0)
    /Users/shibukawa.yoshiki/gopath/src/github.com/go-gl/gl/v2.1/gl/package.go:24310 +0x4c
github.com/goxjs/gl.ShaderSource(0xc800000002, 0xc82009e1e0, 0x1ce)
    /Users/shibukawa.yoshiki/gopath/src/github.com/goxjs/gl/gl_opengl.go:861 +0xc0
github.com/shibukawa/nanovgo.(*glShader).createShader(0xc82008c000, 0x42ccda0, 0x6, 0x4365cc0, 0x33, 0x0, 0x0, 0x4517840, 0x199, 0x4518040, ...)
    /Users/shibukawa.yoshiki/gopath/src/github.com/shibukawa/nanovgo/gl_backend.go:41 +0x182
github.com/shibukawa/nanovgo.(*glParams).renderCreate(0xc82000a410, 0x0, 0x0)
    /Users/shibukawa.yoshiki/gopath/src/github.com/shibukawa/nanovgo/gl_backend.go:409 +0x259
github.com/shibukawa/nanovgo.createInternal(0x4d442e0, 0xc82000a410, 0x45efde0, 0x0, 0x0)
    /Users/shibukawa.yoshiki/gopath/src/github.com/shibukawa/nanovgo/nanovgo.go:1362 +0x421
github.com/shibukawa/nanovgo.NewContext(0x0, 0x4514828, 0x0, 0x0)
    /Users/shibukawa.yoshiki/gopath/src/github.com/shibukawa/nanovgo/gl_backend.go:25 +0xe1
main.main()
    /Users/shibukawa.yoshiki/gopath/src/github.com/shibukawa/nanovgo/sample/sample.go:45 +0x19e

(tested my sample code with go 1.6 beta1 on Mac)

Go 1.6 will be released end of this month and reject passing go memory block to cgo. Do you have any plan to support 1.6?

Yes, absolutely. Thanks for the heads up.

The solution will be the same as for go-gl/gl#31. Resolving that issue will resolve this one.

Fixed 21 days ago in 46efb3a. I forgot to close this issue.