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 721629 - if gnome-shell gets an error opening a .../gnome-shell/modes directory it just gives up, greeter not displayed
if gnome-shell gets an error opening a .../gnome-shell/modes directory it jus...
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: login-screen
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: Ray Strode [halfline]
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2014-01-06 12:31 UTC by John Hughes
Modified: 2015-02-27 00:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to "fix" the bug (800 bytes, patch)
2014-01-06 12:31 UTC, John Hughes
needs-work Details | Review
fileUtils: Remove listDirAsync() (1.63 KB, patch)
2014-01-09 16:48 UTC, Florian Müllner
committed Details | Review

Description John Hughes 2014-01-06 12:31:19 UTC
Created attachment 265431 [details] [review]
Patch to "fix" the bug

in /usr/share/gnome-shell/js/misc/fileUtils.js, function _collectFromDirectoryAsync if a "gnome-shell/modes" directory (/usr/share/gnome-shell/modes, /usr/local/share/gnome-shell/modes ...) exists then listDirAsync is called to read it's contents.  If listDirAsync can't open the directory then it just throws an exception, leaving gnome-shell dead in the water.

For example:

# mkdir /usr/local/share/gnome-shell/modes
# chmod a-rx /usr/local/share/gnome-shell/modes

now gnome-shell can't display the greeter screen, the user is left with a black screen with an arrow cursor.

This is Debian bug 730177.

A quick and dirty patch is to add a try/catch in listDirAsync.
Comment 1 Florian Müllner 2014-01-09 16:48:29 UTC
Review of attachment 265431 [details] [review]:

Style issues pointed out below apart, the patch is no longer relevant for master - the function in question is no longer used for anything and could just be removed altogether.

::: /usr/share/gnome-shell/js/misc/fileUtils.js.orig
@@ +11,3 @@
                                   Gio.FileQueryInfoFlags.NONE,
                                   GLib.PRIORITY_LOW, null, function (obj, res) {
+	try {

Wrong indentation, and it would be better to use a more minimal try/catch block, e.g. something along the lines of:

let enumerator;
try {
    enumerator = obj.enumerate_children_finish(res);
} catch {
    enumerator = null;
}

[...]

if (enumerator != null)
    enumerator.next_files_async(...);
else
    callback([]);
Comment 2 Florian Müllner 2014-01-09 16:48:57 UTC
Created attachment 265860 [details] [review]
fileUtils: Remove listDirAsync()

It's unused since commit da4238ec681c7, just kill it.
Comment 3 Jasper St. Pierre (not reading bugmail) 2014-01-09 16:53:11 UTC
Review of attachment 265860 [details] [review]:

I thought it was used for the run dialog, which is why I didn't kill it, but apparently not.
Comment 4 Florian Müllner 2014-01-09 18:25:59 UTC
Comment on attachment 265860 [details] [review]
fileUtils: Remove listDirAsync()

Attachment 265860 [details] pushed as f2912ba - fileUtils: Remove listDirAsync()

Leaving open for now, as the fix in attachment 265431 [details] [review] still makes sense in the gnome-3-10 branch ...
Comment 5 Bastien Nocera 2014-11-07 12:06:39 UTC
John, will you be updating the patch following the review?
Comment 6 John Hughes 2014-11-07 14:06:50 UTC
I'm currently using gnome shell 3.14, so I can't really test this.
Comment 7 Bastien Nocera 2014-11-07 14:10:59 UTC
I'll leave this opened for gnome-shell developers to decide whether it's worth fixing in 3.10 and earlier.
Comment 8 Florian Müllner 2015-02-27 00:48:35 UTC
I don't see us updating/testing a 3.10 patch at this point, so let's close this.