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 630990 - lightsoff, swell-foop crash, javascript types not converted to pointers
lightsoff, swell-foop crash, javascript types not converted to pointers
Status: RESOLVED OBSOLETE
Product: seed
Classification: Bindings
Component: libseed
2.31.x
Other Linux
: Normal critical
: ---
Assigned To: seed-maint
Depends on:
Blocks:
 
 
Reported: 2010-09-30 09:05 UTC by Jan de Groot
Modified: 2010-10-13 23:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Testcase to demonstrate problem (166 bytes, application/x-javascript)
2010-09-30 09:05 UTC, Jan de Groot
Details

Description Jan de Groot 2010-09-30 09:05:36 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:
  • #0 g_option_context_parse
    at goption.c line 1749
  • #1 gtk_clutter_init_with_args
    at ./gtk-clutter-util.c line 684
  • #2 ffi_call_unix64
    at src/x86/unix64.S line 75
  • #3 ffi_call
    at src/x86/ffi64.c line 484
  • #4 g_function_info_invoke
    at gifunctioninfo.c line 417
  • #5 seed_gobject_method_invoked
    at seed-engine.c line 668
  • #6 ??
    from /usr/lib/libwebkit-1.0.so.2
  • #7 ??
    from /usr/lib/libwebkit-1.0.so.2
  • #8 ??
  • #9 ??

Comment 1 Alan Knowles 2010-09-30 16:57:32 UTC
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)
Comment 2 Jan de Groot 2010-09-30 22:26:45 UTC
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?
Comment 3 Alan Knowles 2010-10-01 08:49:32 UTC
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>
Comment 4 Alan Knowles 2010-10-13 23:54:30 UTC
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.