@larryprice
Copy link
Contributor

After upgrading to newer versions of appstream (0.9.7-1 and now 0.9.8-1 on ubuntu 16.10), I am getting consistent crashes when calling find_components consecutively from python3. This script dumps for me every time:

#!/usr/bin/env python

import gi
gi.require_version('AppStream', '1.0')
from gi.repository import AppStream

db = AppStream.Database()
db.open()

db.find_components("gedit", None) # Fine, continue...
db.find_components("gedit", None) # Crash!

The results:

./break_appstream.py:11: Warning: invalid unclassed pointer in cast to 'AsComponent'
  db.find_components("gedit", None) # Crash!
**
GLib:ERROR:/build/glib2.0-4NbKb8/glib2.0-2.49.2/./glib/ghash.c:373:g_hash_table_lookup_node: assertion failed: (hash_table->ref_count > 0)
Aborted (core dumped)

Am I using this incorrectly? I've tried running appstreamcli refresh --force --verbose and seen nothing interesting. I've reproduced this exact issue on another machine. I tested on a machine with ubuntu 16.04 and found that version 0.9.4-1ubuntu1 still works as expected.