GNOME Bugzilla – Bug 694233
WebKit bindings crash when I implement the "window-object-cleared" signal
Last modified: 2013-07-03 12:31:11 UTC
Here's what I'm doing in Python (Ubuntu 12.10): browser = WebKit.WebView() def on_cleared(*args): pass browser.connect("window-object-cleared", on_cleared) And here's the crash from my terminal when that WebView is shown: $ ./webkit.py ** (webkit.py:17260): CRITICAL **: Converting of type 'void' is not implemented ** ERROR:/build/buildd/pygobject-3.4.0/gi/pygi-argument.c:2084:_pygi_argument_from_g_value: code should not be reached zsh: abort (core dumped) ./webkit.py Is that expected? That signal has some gpointer parameters in the C documentation, and I wonder if that's what's causing the problem. My reason for doing any of this is that I'd ultimately like to expose a Python object to JS, so that the code in the page can call methods that I implement in Python. I read that "window-object-cleared" is the preferred place to set such an object in C at least, but maybe it's not possible from the Python bindings? Thanks for any suggestions.
This shouldn't crash. Can you attach a minimal working example which can be used to reproduce the bug? Thanks
Created attachment 241937 [details] Script that demonstrates the problem
The above crashes on Fedora 18 at least. I haven't yet tried it on gnome-3-8 or master.
That script crashes for me on Ubuntu 12.04 and Arch, under both Python2 and Python3.
Created attachment 248307 [details] [review] Add marshalling of GI_TYPE_TAG_VOID held in a GValue to int Replace assertion for this case with a simple marshalling of the pointer value to a Python int. While not particularly useful this allows some callbacks in WebKit to function without causing a segfault.