After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 694233 - WebKit bindings crash when I implement the "window-object-cleared" signal
WebKit bindings crash when I implement the "window-object-cleared" signal
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: introspection
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks: 699435
 
 
Reported: 2013-02-20 02:10 UTC by Jack O'Connor
Modified: 2013-07-03 12:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Script that demonstrates the problem (205 bytes, text/x-python)
2013-04-19 17:42 UTC, Philip Chimento
  Details
Add marshalling of GI_TYPE_TAG_VOID held in a GValue to int (1.11 KB, patch)
2013-07-03 12:30 UTC, Simon Feltman
committed Details | Review

Description Jack O'Connor 2013-02-20 02:10:49 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.
Comment 1 Simon Feltman 2013-04-19 10:49:54 UTC
This shouldn't crash. Can you attach a minimal working example which can be used to reproduce the bug?

Thanks
Comment 2 Philip Chimento 2013-04-19 17:42:49 UTC
Created attachment 241937 [details]
Script that demonstrates the problem
Comment 3 Philip Chimento 2013-04-19 17:43:52 UTC
The above crashes on Fedora 18 at least. I haven't yet tried it on gnome-3-8 or master.
Comment 4 Jack O'Connor 2013-04-19 19:06:23 UTC
That script crashes for me on Ubuntu 12.04 and Arch, under both Python2 and Python3.
Comment 5 Simon Feltman 2013-07-03 12:30:55 UTC
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.