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 651225 - Trying to load an unknown gsetting schemas crash gnome-shell
Trying to load an unknown gsetting schemas crash gnome-shell
Status: RESOLVED DUPLICATE of bug 651240
Product: gnome-shell
Classification: Core
Component: extensions
unspecified
Other Linux
: Normal critical
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-05-27 09:28 UTC by ecyrbe
Modified: 2011-05-27 15:10 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description ecyrbe 2011-05-27 09:28:28 UTC
When you try to load an unknown gsetting schemas within an extension, the entire gnome shell crash and you can't even close the session.
You have no other alternative than rebooting,

To reproduce the bug just put this in any extension code in gnome-shell, but i fear that this is reproductible in any gnome shell code place:

let settings = new Gio.Settings({ schema: 'org.gnome.fantasy.schemas' });
Comment 1 Rui Matos 2011-05-27 09:38:23 UTC
This is a known issue with the gsettings API.
Comment 2 Milan Bouchet-Valat 2011-05-27 09:50:09 UTC
This can also be considered as a bug in the Shell: if you install a broken extension that makes it crash, you should always get something working in the end. Either fallback mode, or a Shell with extensions disabled, but not *nothing*.

The behavior of GSettings with missing schemas is sane: if we don't have them, what can the program possibly do? If programmers can't rely on the fact that the schema is always present, they'll need to hardcode fallback values and ugly code paths, which is a waste of time.

The only improvement I can think of is to add a g_settings_new_do_not_abort() function that would allow programs loading extensions to stop loading the extension in case of missing schema instead of aborting. But that supposes more complexity, and there's no guarantee extension authors would correclty use it.
Comment 3 ecyrbe 2011-05-27 09:59:51 UTC
gsettings should not abort. an exeption, or an error should be emited and you should let the programmer exit the program accordingly.
You can't make the whole shell abort because it's the sane thing to do! it's nonsense.
The programmer can deal with this in a clean way, even alerting the user of a faulty installation. But aborting is not the way to go...
Comment 4 Matthias Clasen 2011-05-27 10:58:39 UTC
This is working as designed.
Comment 5 ecyrbe 2011-05-27 11:20:46 UTC
Then designers should review their copies. Just to be clear.
You can't make the developper desktop blow away everytime he make a small mistake.
You can't make the user desktop go away every time he  installs something badly.
I hope this is not going to be a 'won't fix' , 'your desktop is crashing by design'.
The design is clearly bad. please reconsider this, you can't let all the gnome 3 destop abort because you made a design decision you think is sane.
This is not sane, it's lame.
I just took a look in gsettings code source, and i see nothing that prevents it from returning a null pointer on failure. althought retrieving an optional error should be allowed for logging purposes.
Comment 6 Dan Winship 2011-05-27 12:48:39 UTC
(In reply to comment #2)
> The only improvement I can think of is to add a g_settings_new_do_not_abort()
> function that would allow programs loading extensions to stop loading the
> extension in case of missing schema instead of aborting. But that supposes more
> complexity, and there's no guarantee extension authors would correclty use it.

The extension loader could provide such a function by having it call g_settings_list_schemas() first and seeing if the requested schema was included there.
Comment 7 Dan Winship 2011-05-27 12:50:46 UTC
oops

*** This bug has been marked as a duplicate of bug 651240 ***
Comment 8 Owen Taylor 2011-05-27 15:10:16 UTC
(In reply to comment #4)
> This is working as designed.

Well, it might be working as designed from C, but the fact that accessing a not-present schema from an interpreted language is an abort not an exception is a disaster. We need to fix that.