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 660147 - tracker causes g_critical in "gsettings list-recursively"
tracker causes g_critical in "gsettings list-recursively"
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-09-26 15:12 UTC by Colin Walters
Modified: 2011-10-01 13:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GSettings schemas: allow for zero items in schema (1013 bytes, patch)
2011-09-26 15:23 UTC, Allison Karlitskaya (desrt)
accepted-commit_now Details | Review
GSettings schemas: allow for zero items in schema (1015 bytes, patch)
2011-10-01 13:45 UTC, Matthias Clasen
committed Details | Review

Description Colin Walters 2011-09-26 15:12:00 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

Thread 3 (Thread 0x7fffebfff700 (LWP 25673))

  • #0 sendmsg
    at ../sysdeps/unix/syscall-template.S line 82
  • #1 g_socket_send_message
    at /src/glib/gio/gsocket.c line 3041
  • #2 write_message_continue_writing
    at /src/glib/gio/gdbusprivate.c line 990
  • #3 maybe_write_next_message
    at /src/glib/gio/gdbusprivate.c line 1452
  • #4 message_written
    at /src/glib/gio/gdbusprivate.c line 1251
  • #5 write_message_cb
    at /src/glib/gio/gdbusprivate.c line 1285
  • #6 g_simple_async_result_complete
    at /src/glib/gio/gsimpleasyncresult.c line 749
  • #7 write_message_continue_writing
    at /src/glib/gio/gdbusprivate.c line 1051
  • #8 maybe_write_next_message
    at /src/glib/gio/gdbusprivate.c line 1452
  • #9 message_written
    at /src/glib/gio/gdbusprivate.c line 1251
  • #10 write_message_cb
    at /src/glib/gio/gdbusprivate.c line 1285
  • #11 g_simple_async_result_complete
    at /src/glib/gio/gsimpleasyncresult.c line 749
  • #12 write_message_continue_writing
    at /src/glib/gio/gdbusprivate.c line 1051
  • #13 maybe_write_next_message
    at /src/glib/gio/gdbusprivate.c line 1452
  • #14 message_written
    at /src/glib/gio/gdbusprivate.c line 1251
  • #15 write_message_cb
    at /src/glib/gio/gdbusprivate.c line 1285
  • #16 g_simple_async_result_complete
    at /src/glib/gio/gsimpleasyncresult.c line 749
  • #17 write_message_continue_writing
    at /src/glib/gio/gdbusprivate.c line 1051
  • #18 maybe_write_next_message
    at /src/glib/gio/gdbusprivate.c line 1452
  • #19 message_written
    at /src/glib/gio/gdbusprivate.c line 1251
  • #20 write_message_cb
    at /src/glib/gio/gdbusprivate.c line 1285
  • #21 g_simple_async_result_complete
    at /src/glib/gio/gsimpleasyncresult.c line 749
  • #22 write_message_continue_writing
    at /src/glib/gio/gdbusprivate.c line 1051
  • #23 maybe_write_next_message
    at /src/glib/gio/gdbusprivate.c line 1452
  • #24 write_message_in_idle_cb
    at /src/glib/gio/gdbusprivate.c line 1473
  • #25 g_main_dispatch
    at /src/glib/glib/gmain.c line 2388
  • #26 g_main_context_dispatch
    at /src/glib/glib/gmain.c line 2925
  • #27 g_main_context_iterate
    at /src/glib/glib/gmain.c line 3000
  • #28 g_main_context_iterate
    at /src/glib/glib/gmain.c line 2933
  • #29 g_main_loop_run
    at /src/glib/glib/gmain.c line 3197
  • #30 gdbus_shared_thread_func
    at /src/glib/gio/gdbusprivate.c line 276
  • #31 g_thread_create_proxy
    at /src/glib/glib/gthread.c line 1677
  • #32 start_thread
    at pthread_create.c line 305
  • #33 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 115

Thread 1 (Thread 0x7ffff732a7c0 (LWP 25669))

  • #0 g_logv
    at /src/glib/glib/gmessages.c line 627
  • #1 g_log
    at /src/glib/glib/gmessages.c line 641
  • #2 g_strv_length
    at /src/glib/glib/gstrfuncs.c line 3047
  • #3 g_settings_schema_list
    at /src/glib/gio/gsettingsschema.c line 352
  • #4 g_settings_list_keys
    at /src/glib/gio/gsettings.c line 2314
  • #5 enumerate
    at /src/glib/gio/gsettings-tool.c line 221
  • #6 gsettings_list_recursively
    at /src/glib/gio/gsettings-tool.c line 277
  • #7 main
    at /src/glib/gio/gsettings-tool.c line 802

Comment 1 Colin Walters 2011-09-26 15:12:49 UTC
(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"}
Comment 2 Colin Walters 2011-09-26 15:14:31 UTC
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?
Comment 3 Allison Karlitskaya (desrt) 2011-09-26 15:20:21 UTC
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.
Comment 4 Allison Karlitskaya (desrt) 2011-09-26 15:23:20 UTC
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.
Comment 5 Matthias Clasen 2011-09-30 00:32:58 UTC
Review of attachment 197490 [details] [review]:

Looks fine to me.
Comment 6 Matthias Clasen 2011-10-01 13:44:57 UTC
The following fix has been pushed:
65b7a20 GSettings schemas: allow for zero items in schema
Comment 7 Matthias Clasen 2011-10-01 13:45:02 UTC
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.