GNOME Bugzilla – Bug 629355
[g-i 0.9.5] g-ir-scanner crashes for libpanel-applet
Last modified: 2015-02-07 16:44:54 UTC
Here's the command-line with the exception: /gnome/usr/bin/g-ir-scanner --warn-all --add-include-path=. --namespace=PanelApplet --nsversion=3.0 --libtool="/bin/sh ../libtool" --include=GObject-2.0 --include=Gtk-2.0 --include=GConf-2.0 --library=libpanel-applet-3.la --identifier-prefix=PanelApplet --symbol-prefix=panel_applet -I../libpanel-applet -I../libpanel-applet -DPANEL_APPLET_DATADIR=\""/gnome/usr/share"\" -DGNOMELOCALEDIR=\""/gnome/usr/share/locale"\" -pthread -DORBIT2=1 -I/gnome/usr/include/gtk-2.0 -I/gnome/usr/lib/gtk-2.0/include -I/gnome/usr/include/atk-1.0 -I/gnome/usr/include/cairo -I/gnome/usr/include/gdk-pixbuf-2.0 -I/gnome/usr/include/pango-1.0 -I/gnome/usr/include/glib-2.0 -I/gnome/usr/lib/glib-2.0/include -I/gnome/usr/include/pixman-1 -I/gnome/usr/include/gconf/2 -I/gnome/usr/include/orbit-2.0 -I/gnome/usr/include/gio-unix-2.0/ -I/usr/include/freetype2 -I/usr/include/libpng12 panel-applet.c panel-applet.h panel-applet-gconf.c panel-applet-gconf.h panel-applet-enums.c panel-applet-enums.h libpanel-applet-3.la Makefile --output PanelApplet-3.0.gir g-ir-scanner: compile: gcc -Wall -pthread -I/gnome/usr/include/glib-2.0 -I/gnome/usr/lib/glib-2.0/include -I/gnome/usr/include/gobject-introspection-1.0 -g -O0 -I../libpanel-applet -I../libpanel-applet -I/gnome/usr/include/gtk-2.0 -I/gnome/usr/lib/gtk-2.0/include -I/gnome/usr/include/atk-1.0 -I/gnome/usr/include/cairo -I/gnome/usr/include/gdk-pixbuf-2.0 -I/gnome/usr/include/pango-1.0 -I/gnome/usr/include/glib-2.0 -I/gnome/usr/lib/glib-2.0/include -I/gnome/usr/include/pixman-1 -I/gnome/usr/include/gconf/2 -I/gnome/usr/include/orbit-2.0 -I/gnome/usr/include/gio-unix-2.0/ -I/usr/include/freetype2 -I/usr/include/libpng12 -I/gnome/usr/include/glib-2.0 -I/gnome/usr/lib/glib-2.0/include -I/gnome/usr/include/gio-unix-2.0/ -I/gnome/usr/include/cairo -I/gnome/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -c -o /home/vuntz/work/gnome/sources/current/gnome-panel/libpanel-applet/tmp-introspect7UOW8E/PanelApplet-3.0.o /home/vuntz/work/gnome/sources/current/gnome-panel/libpanel-applet/tmp-introspect7UOW8E/PanelApplet-3.0.c g-ir-scanner: link: /bin/sh ../libtool --mode=link --tag=CC --silent gcc -o /home/vuntz/work/gnome/sources/current/gnome-panel/libpanel-applet/tmp-introspect7UOW8E/PanelApplet-3.0 -g -O0 -L. -Wl,--export-dynamic -pthread -L/gnome/usr/lib -lgirepository-1.0 -lffi -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 libpanel-applet-3.la -pthread -Wl,--export-dynamic -L/gnome/usr/lib -lgio-2.0 -lgirepository-1.0 -lffi -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 /home/vuntz/work/gnome/sources/current/gnome-panel/libpanel-applet/tmp-introspect7UOW8E/PanelApplet-3.0.o Traceback (most recent call last):
+ Trace 223652
sys.exit(scanner_main(sys.argv))
gdump_parser.parse()
self._introspect_type(child)
self._introspect_object(xmlnode)
(get_type, c_symbol_prefix) = self._split_type_and_symbol_prefix(xmlnode)
assert name.endswith('_get_type') AssertionError
Quickly debugging this: in _split_type_and_symbol_prefix(), name was 'get_type'. My guess is that the scanner doesn't support libraries libpanel-applet where the prefix (identifier & symbol) of the library is all that identifies an object: when you remove the prefix, the object identifier is empty. In this case, we have a PanelApplet object. And the prefix is PanelApplet too.
This commit should avoid the assertion: http://git.gnome.org/browse/gobject-introspection/commit/?id=3236f2c4bb6e58f64f48b10f2b826b86c30aad16 However there's nothing the scanner can do about this - the class would have an empty name. I'm not sure what the old scanner did (maybe just not strip the prefix at all, so you'd have e.g. PanelApplet.PanelApplet, which is basically just broken). You should update PanelApplet to pass --strip-prefix=Panel I guess, then you'd get "PanelApplet.Applet".
Colin: thanks, your proposal is indeed the best solution. I'll use this. I suggest to document this case (maybe as an error in the parser, when the class has an empty name), since it also happened to totem-pl-parser (bug 629562), and then close the bug.
Ah sorry, forgot to mention earlier I did that already: http://git.gnome.org/browse/gobject-introspection/commit/?id=3236f2c4bb6e58f64f48b10f2b826b86c30aad16
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]