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 629355 - [g-i 0.9.5] g-ir-scanner crashes for libpanel-applet
[g-i 0.9.5] g-ir-scanner crashes for libpanel-applet
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: Normal critical
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2010-09-11 12:26 UTC by Vincent Untz
Modified: 2015-02-07 16:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Vincent Untz 2010-09-11 12:26:34 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):
  • File "/gnome/usr/bin/g-ir-scanner", line 45 in <module>
    sys.exit(scanner_main(sys.argv))
  • File "/gnome/usr/lib/gobject-introspection/giscanner/scannermain.py", line 343 in scanner_main
    gdump_parser.parse()
  • File "/gnome/usr/lib/gobject-introspection/giscanner/gdumpparser.py", line 108 in parse
    self._introspect_type(child)
  • File "/gnome/usr/lib/gobject-introspection/giscanner/gdumpparser.py", line 238 in _introspect_type
    self._introspect_object(xmlnode)
  • File "/gnome/usr/lib/gobject-introspection/giscanner/gdumpparser.py", line 293 in _introspect_object
    (get_type, c_symbol_prefix) = self._split_type_and_symbol_prefix(xmlnode)
  • File "/gnome/usr/lib/gobject-introspection/giscanner/gdumpparser.py", line 282 in _split_type_and_symbol_prefix
    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.
Comment 1 Colin Walters 2010-09-13 18:47:21 UTC
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".
Comment 2 Vincent Untz 2010-09-14 06:20:16 UTC
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.
Comment 3 Colin Walters 2010-09-14 16:36:39 UTC
Ah sorry, forgot to mention earlier I did that already:

http://git.gnome.org/browse/gobject-introspection/commit/?id=3236f2c4bb6e58f64f48b10f2b826b86c30aad16
Comment 4 André Klapper 2015-02-07 16:44:54 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]