GNOME Bugzilla – Bug 660147
tracker causes g_critical in "gsettings list-recursively"
Last modified: 2011-10-01 13:45:02 UTC
GLib-CRITICAL **: g_strv_length: assertion `str_array != NULL' failed Program received signal SIGTRAP, Trace/breakpoint trap. g_logv (log_domain=0x7ffff7d8d50e "GLib", log_level=<optimized out>, format=0x7ffff7d95fe3 "%s: assertion `%s' failed", args1=0x7fffffffd7b8) at /src/glib/glib/gmessages.c:627 warning: Source file is more recent than executable. 627 Missing separate debuginfos, use: debuginfo-install libselinux-2.0.99-4.fc15.x86_64 zlib-1.2.5-3.fc15.x86_64 (gdb) t a a bt
+ Trace 228581
Thread 3 (Thread 0x7fffebfff700 (LWP 25673))
Thread 1 (Thread 0x7ffff732a7c0 (LWP 25669))
(gdb) p *schema->priv $1 = {gettext_domain = 0x0, path = 0x7ffff754b510 "/org/freedesktop/tracker/miner/", items = 0x0, n_items = 0, table = 0x7fffe4016de0, name = 0x634a10 "org.freedesktop.Tracker.Miner"}
This appears to be because tracker ships: org.freedesktop.Tracker.gschema.xml.in org.freedesktop.Tracker.Miner.Files.gschema.xml.in but no org.freedesktop.Tracker.Miner.gschema.xml.in Is this legal use of GSettings or not?
Filenames are almost entirely ignored by GSettings. I think this is a simple case of one piece of code thinking that NULL is the same as an empty list and another piece of code expecting an actual empty list. This could probably be an extremely low-impact patch for glib-2-30. Looking into it.
Created attachment 197490 [details] [review] GSettings schemas: allow for zero items in schema GVDB deals with empty lists by returning NULL for the list instead of a zero-length (non-NULL) strv. We can work around that in GSettingsSchema by checking for the NULL case and treating it like a zero-length list.
Review of attachment 197490 [details] [review]: Looks fine to me.
The following fix has been pushed: 65b7a20 GSettings schemas: allow for zero items in schema
Created attachment 197960 [details] [review] GSettings schemas: allow for zero items in schema GVDB deals with empty lists by returning NULL for the list instead of a zero-length (non-NULL) strv. We can work around that in GSettingsSchema by checking for the NULL case and treating it like a zero-length list.