GNOME Bugzilla – Bug 630990
lightsoff, swell-foop crash, javascript types not converted to pointers
Last modified: 2010-10-13 23:54:30 UTC
Created attachment 171411 [details] Testcase to demonstrate problem The games "lightsoff" and "swell-foop" included in gnome-games crash with a segmentation fault. This crashe happens during the call to "GtkClutter.init_with_args(Seed.argv.length, Seed.argv);". Attached is a testcase. It appears that gtk_clutter_init_with_args is not called with a pointer to Seed.argv.length, but with the actual value itself. I don't know if this is a bug in Seed or gobject-introspection, but the .gir files for clutter-gtk are correct and show int* as type. Backtrace:
+ Trace 223952
This is probably a gir issue If you look at this, the signature is wrong in my generated gir file http://www.roojs.com/seed/GtkClutter.html#.init_with_args - It looks like the annotations in GTkClutters git repo are correct now, so If I regenerate the gir/typelib from git it should be correct I suspect this has been fixed recently. you could try installing GtkClutter from git, and make sure you have gobject introspection installed - it should generate a new gir/typelib (delete any old ones in /usr/lib/girepository-1.0 and /usr/share/gir-1.0)
The clutter-gtk package we have on archlinux is actually 0.10.8 with the latest two patches from git, so the annotations in GtkClutter are correct. This is what is in my .gir file: <parameter name="argc" direction="out" caller-allocates="0" transfer-ownership="full"> <type name="int" c:type="int*"/> </parameter> Notice the int* c:type, so the annotations and generated gir files should be correct. Did you actually try the attached testcase?
Unfortunatly I'm in spain at present, and access to my test machines in Hong Kong is a bit slow, I will try testing in detail when I get back. I did test it on my portable (ubuntu with the gir's from the doc site) and it did not segfault. The parameters should look something like below - which is gtk.init() . (note the direction="inout" on argc and length="0" on the array on argv) I'm wondering if seed may ignore the argc anyway (as it's the size of the array in argv - so the signature might be GtkClutter.init_with_args(Seed.argv); you can modify the gir by hand for testing, and use g-ir-compiler input.gir -o output.typelib <parameters> <parameter name="argc" direction="inout" caller-allocates="0" transfer-ownership="full"> <type name="int" c:type="int*"/> </parameter> <parameter name="argv" direction="inout" caller-allocates="0" transfer-ownership="full" allow-none="1"> <array length="0" c:type="char***"> <type name="utf8"/> </array>
Looks like it's been fixed in clutter's git. http://git.clutter-project.org/clutter-gtk/commit/?id=f52ed207ea55961698004a9e7760b6cb59a00516 This really needs testing against head in all projects (which is a bit of a nightmare to set up..) - gtk - clutter - introspection - seed I'm going to mark it resolved as I'm pretty certain it does not affect new releases.