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

StatusIcon demo not running on Mac OS X #262

Closed
niels-s opened this issue Apr 8, 2016 · 1 comment
Closed

StatusIcon demo not running on Mac OS X #262

niels-s opened this issue Apr 8, 2016 · 1 comment

Comments

@niels-s
Copy link

niels-s commented Apr 8, 2016

Hey,

I'm just starting out with this lib and gave the example/statusicon a try. But when starting it I get the following error:

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

goroutine 1 [running]:
panic(0x4164de0, 0xc82000a3c0)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/panic.go:464 +0x3e6
github.com/mattn/go-gtk/gtk._cgoCheckPointer0(0x4129980, 0xc8200103e0, 0xc82000a3b0, 0x1, 0x1, 0xc82000a374)
    ??:0 +0x4d
github.com/mattn/go-gtk/gtk.Init(0x429a420)
    /workspace/go/src/github.com/mattn/go-gtk/gtk/gtk.go:228 +0x3fd
main.main()
    /workspace/go/src/github.com/mattn/go-gtk/example/statusicon/statusicon.go:11 +0x2f
exit status 2

The problem seems to be passing the os.Args to gtk.Init function. I've noticed most of the example use the os.Args to initialize gtk. I've also try to pass nil value, then the demo started but I when I click on the tray icon it crashed on me with this error:

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

goroutine 1 [running]:
panic(0x4164de0, 0xc820072230)
    /usr/local/Cellar/go/1.6/libexec/src/runtime/panic.go:464 +0x3e6
github.com/mattn/go-gtk/gtk._cgoCheckPointer0(0x4129980, 0xc820088120, 0xc820072220, 0x1, 0x1, 0x41193c0)
    ??:0 +0x4d
github.com/mattn/go-gtk/gtk.(*Menu).Popup(0xc820086020, 0x0, 0x0, 0x0, 0x0, 0x41e2d48, 0x4182660, 0xc820086028, 0x1, 0x5)
    /workspace/go/src/github.com/mattn/go-gtk/gtk/gtk.go:5514 +0x2f9
main.main.func2(0xc82008a140)
    /workspace/go/src/github.com/mattn/go-gtk/example/statusicon/statusicon.go:27 +0xce
reflect.Value.call(0x412c500, 0xc8200880a0, 0x13, 0x419b680, 0x4, 0xc8200880c0, 0x1, 0x1, 0x0, 0x0, ...)
    /usr/local/Cellar/go/1.6/libexec/src/reflect/value.go:435 +0x120d
reflect.Value.Call(0x412c500, 0xc8200880a0, 0x13, 0xc8200880c0, 0x1, 0x1, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go/1.6/libexec/src/reflect/value.go:303 +0xb1
github.com/mattn/go-gtk/glib._go_glib_callback(0x5b1cb50)
    /workspace/go/src/github.com/mattn/go-gtk/glib/glib.go:758 +0x1de
github.com/mattn/go-gtk/glib._cgoexpwrap_b00a5877f6a0__go_glib_callback(0x5b1cb50)
    ??:0 +0x21
github.com/mattn/go-gtk/gtk._Cfunc_gtk_main()
    ??:0 +0x36
github.com/mattn/go-gtk/gtk.Main()
    /workspace/go/src/github.com/mattn/go-gtk/gtk/gtk.go:248 +0x14
main.main()
    /workspace/go/src/github.com/mattn/go-gtk/example/statusicon/statusicon.go:39 +0x32e
exit status 2

I'm not sure if this is a bug or behaviour of Mac OS X, any recommendations I can try to fix this?

ps: I've randomly tested a couple of other example which pass the os.Args to gtk.Init, they all have the same problem. I think the issues comes from me using Go 1.6. I'm going to install 1.5.x and see if that works

@mattn I've noticed you comments on golang/go#12416 so I assume this is a Go 1.6 issue.

I've downgraded to Go 1.5.3 this solve the issue for now

@niels-s
Copy link
Author

niels-s commented Apr 13, 2016

Downgrade to Go 1.5.3 for now, until go 1.6 support is implemented

@niels-s niels-s closed this as completed Apr 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant