GNOME Bugzilla – Bug 707020
g_get_system_data_dirs() is used for keybindings and ignores install path
Last modified: 2021-06-09 16:07:54 UTC
If gnome-control-center is installed outside of the main system paths, it will fail to read the correct keybindings files. This can cause a crash if there are keybindings files present in the system data dirs that conflict in some fashion with the version being run. Additionally, the current logic of iterating over each returned directory to see if a specific directory is contained therein seems inefficient, considering the directory seems to be specific to gnome-control-center. It would appear to be more efficient and more correct to use the gnome-control-center installation data dir.
For the record, a crash currently happens when using jhbuild to build 3.10 on fedora 19 and installing somewhere in $HOME (adding this so people will find this bug when searching for the error message): (gnome-control-center:13422): GLib-GIO-ERROR **: Settings schema 'org.gnome.shell.keybindings' does not contain a key named 'toggle-recording' Program received signal SIGTRAP, Trace/breakpoint trap. 0x00007ffff0027d91 in g_logv (log_domain=0x7ffff0cc6698 "GLib-GIO", log_level=G_LOG_LEVEL_ERROR, format=<optimized out>, args=args@entry=0x7fffffffc1b8) at gmessages.c:989 989 G_BREAKPOINT (); (gdb) bt
+ Trace 232449
Created attachment 254024 [details] [review] keyboard: Don't crash loading nonexistent keybinding settings Since we try to load gsettings from schemas and keys specified in XML files found on the filesystem, i.e. we don't have complete control over them, it doesn't make sense to crash, as is the default GSettings behavior, for nonexistent entries. -- I think using system_data_dirs() is fine. In any case we shouldn't be crashing if someone makes a mistake while editing one of these files.
Will using g_system_data_dirs() exclude the install root, or will it read properly?
Comment on attachment 254024 [details] [review] keyboard: Don't crash loading nonexistent keybinding settings Hey Rui; the patch works but wouldn't it be better to exclude the key when populating the list? At the moment it gives the false idea a "toggle recording" action exists.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new bug report at https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/ Thank you for your understanding and your help.