Comment 40 for bug 411358

Revision history for this message
In , Jon-mozillabugzilla (jon-mozillabugzilla) wrote :

I've been doing a load of additional research on this bug because it's causing me daily annoyance...

In response to Sandy Knight: This issue will not corrupt your profile.

I've hooked up gdb to thunderbird and in combination with the source code and a bit of a crash course in reading c++ I feel I know much more about the problem...

1) If my interpretation of RFC2396 is correct, then although a string like "GMT+00:00" looks obviously like a Time Zone and not a URI, it does actually match the regex for a URI schema, which is why a call is made to gconf to look for a handler.

2) GConf does not accept '+' in the names of keys or directories. This means that gconf is technically unsuitable for mapping URI handlers, except that I can find no examples of a real-world URI

3) Since at least Thunderbird 10.0.1 (and I believe much older), "GMT+00:00" would be parsed as a URI and checked with gconf. The error message "Bad key or directory name: "/desktop/gnome/url-handlers/GMT+02/command": `+' is an invalid character in key/directory names" has been around/happening for a very long time.

4) Important difference:
- The x86_x64 binary release of Thunderbird 14.0 ( ftp://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/14.0/linux-x86_64/ ) does not show popup a dialog when the error occurs
- The Ubuntu 'thunderbird_14.0+build1-0ubuntu0.10.04.1' package *does* show a popup when the error occurrs.

5) I tried diff'ing the source trees of the Ubuntu TB 14.0 source and the Mozilla TB 14.0 source and I can find no significant differences. So I think the problem is introduced dependant on how the package gets built.

6) The error message "An error occurred while loading or saving configuration information for %s. Some of your configuration settings may not work properly." is generated by the gconf global default error handler defined in libgnomeui/gnome-gconf-ui.c

**AFTER** Typing all the stuff above I decided to try diffing an 'lsof' of good and bad examples of thunderbird running. One significant difference I noticed is that the Ubuntu package is using GIO libraries whereas the Mozilla package is not.
In the config help the default is GIO-disabled:
 "--enable-gio Enable GIO support (default: disabled)"

I can now see that in fact when thunderbird triggers a pop up it is when it is using GIO and not GConf. I got confused for quite a while until I looked at the implementation of g_app_info_get_default_for_uri_scheme which ultimately uses GConf to obtain the information.

Right now I'm taking a guess that the reason this error appears as a popup in the GIO implementation is because it does not catch and return the error unlike the gconf implementation in Thunderbird. The default error_mode is GCONF_CLIENT_HANDLE_UNRETURNED, which I'm now taking to mean "Only use the default handler for errors which haven't been returned" (thus a pop-up as defined in libgnomeui).

I'll keep looking at this when I have time...

Possible Workarounds:
-----------------------
To avoid the problem (at least on a Ubuntu host,) you can use the Thunderbird binaries supplied by Mozilla
Or
You could rename/move the /usr/lib/gio/modules/libgiogconf.so file so that Thunderbird can't find it. WARNING: I don't know if this is critical to other applications - rename it at your own risk and be prepared for other applications to break.