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 684370 - crashes with KeyError if annotations refer to invalid namespaces
crashes with KeyError if annotations refer to invalid namespaces
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
2.33.x
Other Linux
: Low trivial
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
: 686536 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-09-19 10:39 UTC by Martin Pitt
Modified: 2015-02-07 16:49 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Martin Pitt 2012-09-19 10:39:41 UTC
When building the current libsocialweb (http://ftp.acc.umu.se/pub/GNOME/sources/libsocialweb/0.25/) with g-i 2.33.10, it fails with

Traceback (most recent call last):
  • File "/usr/bin/g-ir-scanner", line 46 in <module>
    sys.exit(scanner_main(sys.argv))
  • File "/usr/lib/gobject-introspection/giscanner/scannermain.py", line 433 in scanner_main
    final.validate()
  • File "/usr/lib/gobject-introspection/giscanner/introspectablepass.py", line 37 in validate
    self._namespace.walk(self._introspectable_callable_analysis)
  • File "/usr/lib/gobject-introspection/giscanner/ast.py", line 457 in walk
    node.walk(callback, [])
  • File "/usr/lib/gobject-introspection/giscanner/ast.py", line 539 in walk
    self._walk(callback, chain)
  • File "/usr/lib/gobject-introspection/giscanner/ast.py", line 969 in _walk
    sig.walk(callback, chain)
  • File "/usr/lib/gobject-introspection/giscanner/ast.py", line 534 in walk
    res = callback(self, chain)
  • File "/usr/lib/gobject-introspection/giscanner/introspectablepass.py", line 200 in _introspectable_callable_analysis
    if not self._type_is_introspectable(param.type):
  • File "/usr/lib/gobject-introspection/giscanner/introspectablepass.py", line 134 in _type_is_introspectable
    return self._type_is_introspectable(typeval.element_type)
  • File "/usr/lib/gobject-introspection/giscanner/introspectablepass.py", line 150 in _type_is_introspectable
    target = self._transformer.lookup_typenode(typeval)
  • File "/usr/lib/gobject-introspection/giscanner/transformer.py", line 165 in lookup_typenode
    return self.lookup_giname(typeobj.target_giname)
  • File "/usr/lib/gobject-introspection/giscanner/transformer.py", line 157 in lookup_giname
    include = self._includes[ns]
KeyError: 'Sw'

It works fine with g-i 2.32.1, so that's a regression in 2.33.x.

For now I narrowed this down to this command (needs a built tree):

  cd libsocialweb-client/
  g-ir-scanner -v --namespace SocialWebClient  --identifier-prefix=Sw -I..  --include=GLib-2.0 --include=Gio-2.0 --library=libsocialweb-client.la --warn-all --output SocialWebClient-0.25.gir.tmp  sw-client-item-view.h  sw-client-item-view.c

This .h/.c seems to expose the problem. When I remove this one and keep all others, it works.
Comment 1 Colin Walters 2012-09-19 23:44:20 UTC
Yeah, but this was really not intentionally-exposed functionality.  See

http://git.gnome.org/browse/libsocialweb/commit/?id=c1791e96182815449781fcda6007b69cd88cf7bf
Comment 2 Colin Walters 2012-09-19 23:53:31 UTC
Now we should clearly not crash; for 3.7 I'll add a better error message. But I'm not feeling a lot of motivation to bring this back.  The basic issue is that you have two choices for how to refer to something:

1) C style - SwFooBar
2) GI style - SocialWeb.FooBar

Sw only exists at the C level, so doing Sw.FooBar is a mix of C and GI.
Comment 3 Martin Pitt 2012-09-20 04:33:35 UTC
Ah, thanks for the pointer! So it seems libsocialweb just needs a release (last one was 10 months ago). Adjusting bug title accordingly.
Comment 4 Colin Walters 2012-10-23 14:52:02 UTC
*** Bug 686536 has been marked as a duplicate of this bug. ***
Comment 5 Colin Walters 2012-10-23 14:56:09 UTC
We warn now and continue to function in this scenario, instead of crashing.
Comment 6 André Klapper 2015-02-07 16:49:08 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]