GNOME Bugzilla – Bug 571633
ClutterCairo.create invocation fails
Last modified: 2010-02-18 15:15: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
Props are surfaceWidth, surfaceHeight rather than width, height it looks like.
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.
Does not look like a gjs bug to me, at least not without further investigation to show why it is a gjs bug.
Well, jdahlin told me to fill a bug in GJS. How can I figure out if it is actually a GJS bug?
Debug the problem ... why is it crashing? then you'll know if the why is in gjs or not.
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
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 ;-)
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.
*** This bug has been marked as a duplicate of bug 610370 ***