GNOME Bugzilla – Bug 667985
g-ir-scanner crashes with KeyError on aliased (out) arguments
Last modified: 2018-02-08 12:13:20 UTC
While developing GI support for gnome-keyring in bug 598414 I stumbled over a crash in the scanner when trying to annotate a function with an "out" argument which is a typedef for a GArray: typedef GArray GnomeKeyringAttributeList; /** * gnome_keyring_item_get_attributes_sync: * @keyring: (allow-none): The name of the keyring in which the item exists, or * %NULL for the default keyring. * @id: The id of the item * @attributes: (out): The location to return a pointer to the attribute list. * * Get all attributes for an item. * * A #GnomeKeyringAttributeList will be returned in @attributes. This should be * freed using gnome_keyring_attribute_list_free(). * * For an asynchronous version of this function see gnome_keyring_item_get_attributes(). * * Return value: %GNOME_KEYRING_RESULT_OK if the operation was succcessful or * an error result otherwise. **/ GnomeKeyringResult gnome_keyring_item_get_attributes_sync (const char *keyring, guint32 id, GnomeKeyringAttributeList **attributes) When I added the (out), g-ir-scanner crashes: GISCAN GnomeKeyring-1.0.gir Traceback (most recent call last):
+ Trace 229453
sys.exit(scanner_main(sys.argv))
main.transform()
self._namespace.walk(self._pass_read_annotations)
node.walk(callback, [])
res = callback(self, chain)
self._apply_annotations_function(node, chain)
self._apply_annotations_callable(node, chain, block)
self._apply_annotations_params(node, node.parameters, block)
self._apply_annotations_param(parent, param, tag)
self._apply_annotations_param_ret_common(parent, param, tag)
target = self._transformer.resolve_aliases(target)
typenode = ast.type_names[typenode.target.target_fundamental]
Created attachment 283942 [details] Test header showing problem Seems like the API in question is gone at this point. But the problem mentioned still exists when doing a basic test. In any event, a workaround might be to explicitly annotate the type. * @attributes: (out) (type GArray) (element-type int): Compile test header with: g-ir-scanner --warn-all --warn-error --reparse-validate \ --namespace=Test \ --nsversion=1.0 \ --header-only \ --include=GLib-2.0 \ --cflags-begin `pkg-config gobject-2.0 --cflags` --cflags-end \ --output=Test-1.0.gir test.h
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/62.