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 707020 - g_get_system_data_dirs() is used for keybindings and ignores install path
g_get_system_data_dirs() is used for keybindings and ignores install path
Status: RESOLVED OBSOLETE
Product: gnome-control-center
Classification: Core
Component: Keyboard
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Rui Matos
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-08-28 22:18 UTC by Seán de Búrca
Modified: 2021-06-09 16:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
keyboard: Don't crash loading nonexistent keybinding settings (3.20 KB, patch)
2013-09-03 23:04 UTC, Rui Matos
reviewed Details | Review

Description Seán de Búrca 2013-08-28 22:18:39 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.
Comment 1 Volker Sobek (weld) 2013-09-03 20:04:45 UTC
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
  • #0 g_logv
    at gmessages.c line 989
  • #1 g_log
    at gmessages.c line 1025
  • #2 g_settings_schema_get_value
    at gsettingsschema.c line 640
  • #3 g_settings_schema_key_init
    at gsettingsschema.c line 751
  • #4 g_settings_get_value
    at gsettings.c line 1074
  • #5 settings_get_binding
    at cc-keyboard-item.c line 367
  • #6 cc_keyboard_item_load_from_gsettings
    at cc-keyboard-item.c line 442
  • #7 append_section
    at keyboard-shortcuts.c line 238
  • #8 append_sections_from_file
    at keyboard-shortcuts.c line 531
  • #9 reload_sections
    at keyboard-shortcuts.c line 684
  • #10 keyboard_shortcuts_init
    at keyboard-shortcuts.c line 1850
  • #11 cc_keyboard_panel_constructor
    at cc-keyboard-panel.c line 136
  • #12 g_object_new_with_custom_constructor
    at gobject.c line 1665
  • #13 g_object_new_internal
    at gobject.c line 1744
  • #14 g_object_new_valist
    at gobject.c line 2002
  • #15 g_object_new
  • #16 cc_panel_loader_load_by_name
    at cc-panel-loader.c line 213
  • #17 activate_panel
    at cc-window.c line 154
  • #18 cc_window_set_active_panel_from_id
    at cc-window.c line 1020
  • #19 ffi_call_unix64
    at ../src/x86/unix64.S line 76
  • #20 ffi_call
    at ../src/x86/ffi64.c line 522
  • #21 g_cclosure_marshal_generic
    at gclosure.c line 1454
  • #22 g_closure_invoke
    at gclosure.c line 777
  • #23 signal_emit_unlocked_R
  • #24 g_signal_emit_valist
    at gsignal.c line 3330
  • #25 g_signal_emit
    at gsignal.c line 3386
  • #26 iconview_item_activated_cb
    at cc-shell-item-view.c line 104
  • #27 g_cclosure_marshal_VOID__BOXEDv
    at gmarshal.c line 1160
  • #28 _g_closure_invoke_va
    at gclosure.c line 840
  • #29 g_signal_emit_valist
    at gsignal.c line 3238
  • #30 g_signal_emit
  • #31 gtk_icon_view_button_release
    at gtkiconview.c line 2472
  • #32 _gtk_marshal_BOOLEAN__BOXEDv
    at gtkmarshalers.c line 130
  • #33 _g_closure_invoke_va
    at gclosure.c line 840
  • #34 g_signal_emit_valist
    at gsignal.c line 3238
  • #35 g_signal_emit
    at gsignal.c line 3386
  • #36 gtk_widget_event_internal
    at gtkwidget.c line 7146
  • #37 gtk_widget_event
    at gtkwidget.c line 6808
  • #38 propagate_event_up
  • #39 propagate_event
    at gtkmain.c line 2500
  • #40 gtk_main_do_event
    at gtkmain.c line 1715
  • #41 gdk_event_source_dispatch
    at gdkeventsource.c line 364
  • #42 g_main_dispatch
    at gmain.c line 3065
  • #43 g_main_context_dispatch
    at gmain.c line 3641
  • #44 g_main_context_iterate
    at gmain.c line 3712
  • #45 g_main_context_iteration
    at gmain.c line 3773
  • #46 g_application_run
    at gapplication.c line 1635
  • #47 main
    at main.c line 49

Comment 2 Rui Matos 2013-09-03 23:04:42 UTC
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.
Comment 3 Seán de Búrca 2013-09-03 23:54:21 UTC
Will using g_system_data_dirs() exclude the install root, or will it read properly?
Comment 4 Frederic Peters 2013-11-21 16:27:03 UTC
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.
Comment 5 André Klapper 2021-06-09 16:07:54 UTC
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.