! 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 !
xfconf cache does not handle missing channels correctly
Status:
RESOLVED: INVALID
Product:
Xfconf
Component:
Libxfconf

Comments

Description Andrew Stormont 2012-04-27 17:19:22 CEST
I first noticed with Xfce 4.8 that the xfce4-panel migrate tool would segfault trying to migrate the default config.  This is caused by Xfconf not properly handling the PropertyNotFound dbus error it gets when a property is referenced for the first time.  See fix bellow:

diff --git a/xfconf/xfconf-cache.c b/xfconf/xfconf-cache.c
index 36bd03e..975237a 100644
--- a/xfconf/xfconf-cache.c
+++ b/xfconf/xfconf-cache.c
@@ -752,9 +752,9 @@ xfconf_cache_set(XfconfCache *cache,
             }
 
             if(G_UNLIKELY(!dbus_error_name
-                          || strncmp(dbus_error_name, "org.xfce.Xfconf.Error.", 22)
-                          || (strcmp(dbus_error_name+22, "PropertyNotFound")
-                              && strcmp(dbus_error_name+22, "ChannelNotFound"))))
+                          || strncmp(dbus_error_name, "org.xfce.Xfconf.Error.", 22) == 0
+                          || (strcmp(dbus_error_name+22, "PropertyNotFound") == 0
+                              || strcmp(dbus_error_name+22, "ChannelNotFound") == 0)))
             {
                 /* this is bad... */
                 g_propagate_error(error, tmp_error);

This patch allows the xfce4-panel migration helper to do its job successfully and now my panel is working fine.
Comment 1 Nick Schermer editbugs 2012-04-27 18:00:17 CEST
Created attachment 4369 
Change check

Does this work fine as well?
Comment 2 Andrew Stormont 2012-04-27 18:22:51 CEST
No but this does:

diff --git a/xfconf/xfconf-cache.c b/xfconf/xfconf-cache.c
index 36bd03e..7f011a7 100644
--- a/xfconf/xfconf-cache.c
+++ b/xfconf/xfconf-cache.c
@@ -751,10 +751,8 @@ xfconf_cache_set(XfconfCache *cache,
                 dbus_error_name = dbus_g_error_get_name(tmp_error);
             }
 
-            if(G_UNLIKELY(!dbus_error_name
-                          || strncmp(dbus_error_name, "org.xfce.Xfconf.Error.", 22)
-                          || (strcmp(dbus_error_name+22, "PropertyNotFound")
-                              && strcmp(dbus_error_name+22, "ChannelNotFound"))))
+            if(g_strcmp0(dbus_error_name, "org.xfce.Xfconf.Error.PropertyNotFound") == 0
+               || g_strcmp0(dbus_error_name, "org.xfce.Xfconf.Error.ChannelNotFound") == 0)
             {
                 /* this is bad... */
                 g_propagate_error(error, tmp_error);
Comment 3 Nick Schermer editbugs 2012-04-27 18:27:05 CEST
Then that is not the problem, because PropertyNotFound/ChannelNotFound is expected to happen.
Comment 4 Andrew Stormont 2012-04-27 19:50:00 CEST
I'm mistaken.  It's actually the change to ChannelNotFound which is making things work.
Comment 5 Nick Schermer editbugs 2012-04-27 21:44:33 CEST
Which panel version do you use?
Comment 6 Andrew Stormont 2012-04-27 23:14:09 CEST
The version I'm using is straight from git, but as I said above I've seen this same failure with versions as far back as 4.8.
Comment 7 Steve Dodier-Lazaro editbugs 2015-02-16 20:48:28 CET
Hi Andrew, Nick. I'm not quite sure what is the status of this bug, and whether the patch is still valid and/or relevant. Could you please comment on the report?

Thanks.
Comment 8 Skunnyk editbugs 2019-06-20 17:46:30 CEST
Please open a new bugreport if the problem is still present.

Bug #8787

Reported by:
Andrew Stormont
Reported on: 2012-04-27
Last modified on: 2019-06-20

People

Assignee:
Brian J. Tarricone (not reading bugmail)
CC List:
2 users

Version

Version:
GIT Master

Attachments

Change check (869 bytes, patch)
2012-04-27 18:00 CEST , Nick Schermer
no flags

Additional information