go-gtk icon indicating copy to clipboard operation
go-gtk copied to clipboard

panic in example/drawable.go

Open ecc1 opened this issue 8 years ago • 4 comments

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

goroutine 1 [running]:
panic(0x58b240, 0xc82000a340)
    /usr/lib/go/src/runtime/panic.go:464 +0x3e6
github.com/mattn/go-gtk/gtk._cgoCheckPointer0(0x550dc0, 0xc82000e460, 0xc82000a330, 0x1, 0x1, 0xc82000a2f4)
    ??:0 +0x4d
github.com/mattn/go-gtk/gtk.Init(0x8c7840)
    /home/ecc/go/src/github.com/mattn/go-gtk/gtk/gtk.go:228 +0x3fd
main.main()
    /home/ecc/go/src/github.com/mattn/go-gtk/example/drawable/drawable.go:17 +0x2f
exit status 2

go version go1.6 linux/amd64 go-gtk commit ed2d2dd0968823f4d921f471967bb406253d0127

ecc1 avatar Apr 12 '16 18:04 ecc1

The problem is passing &os.Args to gtk.Init(). When I replace it with gtk.Init(nil), it works fine. Same problem for many of the other example programs.

ecc1 avatar Apr 12 '16 18:04 ecc1

go-gtk is using that passing pointer of go's pointer. But go1.6 include change to make it panic. So most of features are currently doesn't work.

mattn avatar Apr 13 '16 13:04 mattn

This is my TODO. If you want to get workaround, please pass nil into gtk.Init.

mattn avatar Aug 25 '16 03:08 mattn

Any progress on this? Took me couple of hours find the reason why all the examples are broken (doesn't run). I'm running go 1.7.4 on ubuntu 16.04.

You might want to add note to the README.md that if examples doesn't work, try passing nil into gtk.Init.

vhakulinen avatar Dec 17 '16 17:12 vhakulinen