! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
xfwm4-settings handles non-existing xconfd badly
Status:
RESOLVED: MOVED

Comments

Description rindeal 2020-02-09 20:33:13 CET
When trying to run xfwm4-settings 4.12 without xconfd installed this segfault always happen.

Here is a backtrace:

```
#0  0x000055555555cc8c in xfwm_settings_button_layout_property_changed (channel=<optimized out>, property=0x55555555dbcd "/general/button_layout", settings=<optimized out>, 
    value=0x7fffffffd880) at xfwm4-settings.c:1397
#1  xfwm_settings_constructed (object=<optimized out>) at xfwm4-settings.c:501
#2  0x00007ffff6a653d0 in g_object_new_internal (class=class@entry=0x5555558f30f0, params=params@entry=0x7fffffffdaa0, n_params=n_params@entry=1) at gobject.c:1837
#3  0x00007ffff6a6713e in g_object_new_valist (object_type=<optimized out>, first_property_name=<optimized out>, var_args=var_args@entry=0x7fffffffdbf0) at gobject.c:2120
#4  0x00007ffff6a674b9 in g_object_new (object_type=<optimized out>, first_property_name=<optimized out>) at gobject.c:1640
#5  0x0000555555559315 in main (argc=<optimized out>, argv=<optimized out>) at xfwm4-settings.c:931
```

Upon quick inspection of the source code I see that the immediate problem is *not* checking the return status of `xfconf_channel_get_property()`, which sadly seems to be a coding convention across the codebase there, but then happily acting upon its result value. The same then applies inside `xfwm_settings_button_layout_property_changed()`:

```
for (str_value = g_value_get_string (value); *str_value != '\0'; ++str_value)
```

again, *not* checking the return value of `g_value_get_string()`, but happily de-referencing it, which has been causing the segfault. This was fixed 10 months ago in https://git.xfce.org/xfce/xfwm4/commit/?id=5ece9b89905cfa65023f00b8e185fbf438c076f8, however, so it no longer crashes, instead the critical Glib assertion is still triggered and all configuration changes are silently ignored (tested on 4.14).

`xfconf_channel_get_property()` fails, because it cannot communicate with xconfd via dbus. This case should be handled gracefully instead of failing miserably or being silently ignored.
Comment 1 Git Bot editbugs 2020-05-29 12:47:08 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/xfce/xfwm4/-/issues/375.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #16440

Reported by:
rindeal
Reported on: 2020-02-09
Last modified on: 2020-05-29

People

Assignee:
Olivier Fourdan
CC List:
0 users

Version

Version:
unspecified

Attachments

Additional information