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 571633 - ClutterCairo.create invocation fails
ClutterCairo.create invocation fails
Status: RESOLVED DUPLICATE of bug 610370
Product: gjs
Classification: Bindings
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2009-02-13 14:42 UTC by Simon van der Linden
Modified: 2010-02-18 15:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
segmentation fault backtrace (5.23 KB, text/plain)
2009-02-13 20:58 UTC, Simon van der Linden
Details

Description Simon van der Linden 2009-02-13 14:42:32 UTC
gjs> cc = new imports.gi.ClutterCairo.ClutterCairo({width: 42, height: 42});
typein:1: strict warning: assignment to undeclared variable cc
   JS IMPORT: JS import 'gi' not found in /opt/gnome-shell/share/gjs-1.0
   JS IMPORT: JS import 'gi' not found in /usr/share/gjs-1.0
   JS IMPORT: JS import 'gi' not found in /usr/local/share/gjs-1.0
   JS IMPORT: JS import 'gi' not found in /usr/share/gjs-1.0
   JS IMPORT: JS import 'gi' not found in /usr/share/gdm/gjs-1.0
   JS IMPORT: Importing '/opt/gnome-shell/lib/gjs-1.0/gi.so'
   JS IMPORT: Defining parent 0x9bb7780 of 0x9bb7840 'gi' is mod 1
   JS NATIVE: Registered native JS module 'gi'
   JS NATIVE: Defining native module 'gi'
   JS G REPO: Initialized class GIRepository prototype 0x9bb7860
     JS G NS: Initialized class GIRepositoryNamespace prototype 0x9bb78c0
     JS G NS: Defined namespace 'GLib' 0x9bb78e0 in GIRepository 0x9bb7880
   JS IMPORT: successfully imported module 'gi'
     JS G NS: Defined namespace 'ClutterCairo' 0x9bb7900 in GIRepository 0x9bb7880
     JS G NS: Found info type OBJECT for 'ClutterCairo' in namespace 'ClutterCairo'
     JS G NS: Found info type OBJECT for 'ClutterCairo' in namespace 'ClutterCairo'
     JS G NS: Defined namespace 'Clutter' 0x9bb7920 in GIRepository 0x9bb7880
     JS G NS: Found info type OBJECT for 'Texture' in namespace 'Clutter'
     JS G NS: Found info type OBJECT for 'Actor' in namespace 'Clutter'
     JS G NS: Defined namespace 'GObject' 0x9bb7940 in GIRepository 0x9bb7880
     JS G NS: Found info type OBJECT for 'InitiallyUnowned' in namespace 'GObject'
     JS G NS: Found info type OBJECT for 'Object' in namespace 'GObject'
   JS G REPO: Initializing dynamic class Object 0x9bec820
    JS G OBJ: Defined class Object prototype 0x9bb7960 class 0x9bec820 in object 0x9bb7940
   JS G REPO: Initializing dynamic class InitiallyUnowned 0x9bec870
    JS G OBJ: Defined class InitiallyUnowned prototype 0x9bb7980 class 0x9bec870 in object 0x9bb7940
   JS G REPO: Initializing dynamic class Actor 0x9bec8c0
    JS G OBJ: Defined class Actor prototype 0x9bb79a0 class 0x9bec8c0 in object 0x9bb7920
   JS G FUNC: Initialized class GIRepositoryFunction prototype 0x9bb79c0
   JS G REPO: Initializing dynamic class Texture 0x9bec910
    JS G OBJ: Defined class Texture prototype 0x9bb7a00 class 0x9bec910 in object 0x9bb7920
   JS G REPO: Initializing dynamic class ClutterCairo 0x9bec960
    JS G OBJ: Defined class ClutterCairo prototype 0x9bb7a80 class 0x9bec960 in object 0x9bb7900

(gjs-console:4089): Clutter-CRITICAL **: clutter_id_pool_add: assertion `id_pool != NULL' failed

** (gjs-console:4089): WARNING **: Unable to create the Cairo surface: invalid size (0x0)
   JS KP ALV: Initializing keep-alive class in context 0x9bc8950 global 0x9bb73c0
   JS KP ALV: Initialized class __private_GjsKeepAlive prototype 0x9bb7b40
   JS KP ALV: Creating new keep-alive object for context 0x9bc8950 global 0x9bb73c0
    JS G OBJ: storing gtype ClutterCairo (163502840) to prototype 0x9bb7a80
[object _private_ClutterCairo_ClutterCairo]

gjs> cc.create();
    JS G OBJ: Defining method create in prototype for ClutterCairo (ClutterCairo.ClutterCairo)
     JS G NS: Defined namespace 'cairo' 0x8d60b80 in GIRepository 0x8d60880
     JS G NS: Found info type STRUCT for 'Context' in namespace 'cairo'
     JS G NS: Found info type STRUCT for 'Context' in namespace 'cairo'
   JS G REPO: Initializing dynamic class Context 0x8d95db0
    JS G BXD: Defined class Context prototype is 0x8d60ba0 class 0x8d95db0 in object 0x8d60b80
Error: Unhandled GType void releasing SYMBOL GArgument
Comment 1 Havoc Pennington 2009-02-13 15:00:26 UTC
Props are surfaceWidth, surfaceHeight rather than width, height it looks like.
Comment 2 Simon van der Linden 2009-02-13 20:58:28 UTC
Created attachment 128687 [details]
segmentation fault backtrace

(In reply to comment #1)
> Props are surfaceWidth, surfaceHeight rather than width, height it looks like.

Thanks. With these properties, it segfaults.
Comment 3 Havoc Pennington 2009-02-13 21:33:31 UTC
Does not look like a gjs bug to me, at least not without further investigation to show why it is a gjs bug.

Comment 4 Simon van der Linden 2009-02-13 22:35:47 UTC
Well, jdahlin told me to fill a bug in GJS. How can I figure out if it is actually a GJS bug?
Comment 5 Havoc Pennington 2009-02-13 22:38:22 UTC
Debug the problem ... why is it crashing? then you'll know if the why is in gjs or not.
Comment 6 Simon van der Linden 2009-02-14 10:32:18 UTC
Thanks, Havoc. I wouldn't bet I'd have to debug it.

In fact, I forgot to do a Clutter.init() before creating the object with the right properties. Mea culpa.

Now the problem is the same as the initial one:
gjs> let cr = cc.create()
Error: Unhandled GType void releasing SYMBOL GArgument
Comment 7 Havoc Pennington 2009-02-14 15:32:53 UTC
Now that looks like gjs just can't handle cairo_t since it probably has no GType registration (it's not a boxed or an object), so now someone just has to do cairo bindings ;-)
Comment 8 Owen Taylor 2009-02-14 15:35:04 UTC
Well, I think it's gjs keeping up its attempt at "worlds worst error messages".
But other than that, it's probably simply that cairo_t is not a type that is
handled by gobject-introspection.

As discussed in IRC previously, there is no current way to use cairo from gjs.
Comment 9 Johan (not receiving bugmail) Dahlin 2010-02-18 15:15:32 UTC

*** This bug has been marked as a duplicate of bug 610370 ***