GNOME Bugzilla – Bug 473576
defsgen.py crashes when parsing an Interface first
Last modified: 2008-07-16 10:13:05 UTC
Please describe the problem: When defsgen.py is used to parse interfaces it crashes when an interface type is parsed before any GObjects. This is because the class structure for GObject has not been initialized. The GObject class initialization is where the param pool is set up. This could be considered a bug in GObject, but there is a very easy fix in defsgen. One, very small, fix is attached. It just consists of making a call to g_object_new to force the class structure initialization. Steps to reproduce: Run the defsgen.py defs generator on any header file that just contains interface types. Actual results: defsgen.py - An uncaught exception is thrown. (process:20299): GLib-GObject-CRITICAL **: g_param_spec_pool_list: assertion `pool != NULL' failed Traceback (most recent call last):
+ Trace 160385
sys.exit(main(sys.argv))
find_defs(buf, gobj, modlib, defs)
obj.set_properties(gobj)
self.props = self._get_ginterface_properties(gobj)
props = [plist[i][0].name for i in range(num.value)]
Expected results: Does this happen every time? Yes Other information:
Created attachment 94934 [details] [review] Adding g_object_new to fix interface parsing.
Thanks for the bug report and patch. Fixed in trunk: * codegen/defsgen.py (main): Create a GObject to initialize param pool Fixes #473576 (patch by Mark Doffman). Committed revision 2902.
Mark: This definitely sounds like a bug in GObject, can you open up one there to make sure that the param pool is initialized lazily in interfaces just as it is for objects? (properties on interfaces is a fairly new feature)
(In reply to comment #3) > Mark: This definitely sounds like a bug in GObject, can you open up one there > to make sure that the param pool is initialized lazily in interfaces just as it > is for objects? (properties on interfaces is a fairly new feature) > Johan: I have opened under GObject. Bug 473705