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 615462 - Crashes when user selects a session with a .desktop file it can't read
Crashes when user selects a session with a .desktop file it can't read
Status: RESOLVED NOTGNOME
Product: gdm
Classification: Core
Component: general
2.30.x
Other Linux
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2010-04-11 17:48 UTC by Dylan McCall
Modified: 2010-06-09 16:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
syslog with debug messages from GDM, before and after the described crash (170.42 KB, application/octet-stream)
2010-06-06 04:56 UTC, Dylan McCall
Details
desktop file I used. (92 bytes, text/plain)
2010-06-09 02:08 UTC, Brian Cameron
Details

Description Dylan McCall 2010-04-11 17:48:59 UTC
I originally filed this in Launchpad, sending it upstream now that I have more time. Sorry about the delay :)

Very visible via an Ubuntu bug:
https://bugs.edge.launchpad.net/ubuntu/+source/sugar-0.88/+bug/542338



Right now, if I select the Sugar session to log in with, GDM instantly crashes. This is simply upon choosing the Sugar option in the Session combo box.

(Naturally, gdm is restarted immediately, but what I was doing vanishes without warning and, naturally, this renders it impossible to log in to a Sugar session). The following information appears in the system log:

Mar 19 17:30:45 dylan-netbook gdm-session-worker[1439]: GLib-GObject-CRITICAL: g_value_get_boolean: assertion `G_VALUE_HOLDS_BOOLEAN (value)' failed
Mar 19 17:30:49 dylan-netbook gdm-simple-slave[933]: CRITICAL: Cannot read specified session file: sugar.desktop
Mar 19 17:30:49 dylan-netbook gdm-binary[767]: WARNING: GdmDisplay: display lasted 0.112974 seconds
Mar 19 17:30:49 dylan-netbook gdm-simple-greeter[1477]: WARNING: error opening connection: Failed to connect to socket /tmp/gdm-greeter-CveyZvQE: Connection refused



It doesn't need to perform a miracle and parse the session's .desktop file, but GDM probably shouldn't crash here :)
Comment 1 Brian Cameron 2010-04-26 21:11:08 UTC
The error message "Cannot read specified session file:" is coming from the get_session_command() function in the file daemon/gdm-session-direct.c.  This message is printed and the process exits if the function get_session_command_for_file() returns FALSE.  In all error conditions, GDM prints a debug message to your syslog to explain what the problem is, but only if you have debug turned on.

So, could you turn on debug by editing your /etc/gdm/custom.conf file and adding "Enable=true" under the line that says "[debug]" so it looks like this:

[debug]
Enable=true

Then with the problematic desktop file installed to /usr/share/xsessions, restart GDM and allow it to fail.  When this happens, your syslog file (/var/log/messages or /var/adm/messages) should contain GDM-related debug messages near the end.  These messages should highlight exactly what the problem is.

If we could identify exactly what is causing the problem, then it would be easier to fix. 

Thanks,
Comment 2 Dylan McCall 2010-06-06 04:56:59 UTC
Created attachment 162845 [details]
syslog with debug messages from GDM, before and after the described crash

Hi Brian,

Sorry it took me so long to get back to this. I did as you asked :)
I'm attaching a file that has my log from the point that I restarted gdm until it crashed and was restarted.

Lots and lots of debug messages in there. So you know, the offending session file is called sugar.desktop.

I hope this helps! If there is anything else I can do, let me know.
Comment 3 Brian Cameron 2010-06-09 02:08:20 UTC
Created attachment 163163 [details]
desktop file I used.


I just tested with the attached desktop file which runs an xterm, but is otherwise pretty much the same as the desktop file reported as causing a crash in the bug on launchpad.  Selecting this "Problem" desktop file in the GDM login screen works for me and starts an xterm login session with no crashing.

Does GDM crash for you with the attached desktop file?  If not, then can you provide an example of a desktop file that does cause GDM to crash, or explain more specifically what the problem is?

It may also be possible that the reason I do not see the crash is that I am using the latest GDM 2.30.2 release and the issue may have been fixed if you are using an older version of GDM.
Comment 4 Dylan McCall 2010-06-09 02:31:29 UTC
Hi Brian,

Luke figured this out downstream and there is a fix trickling through from Debian for the offending session. Adding a Comment line worked around the crash.

Your test session crashed for me, just like the Sugar one. Gdm shipped with Ubuntu is still 2.30.0, so that probably explains it. Must have been fixed somewhere :)

Thanks for your help!
Comment 5 Brian Cameron 2010-06-09 06:07:42 UTC
Note that the keys for the desktop file are read in the file daemon/gdm-session-direct.c in the function get_session_command_for_file().  The error message "Cannot read specified session file" is displayed if get_session_command_for_file() does not return a valid return code.

However, the upstream GDM code does not try to read the key "Comment" from the configuration file.  This is true for the GDM 2.30.0 and 2.30.1 versions of the code.  Refer here to see the code for 2.30.0.  Both versions only try to read these keys from the file:

- G_KEY_FILE_DESKTOP_KEY_HIDDEN
- G_KEY_FILE_DESKTOP_KEY_TRY_EXEC
- G_KEY_FILE_DESKTOP_KEY_EXEC

Refer here to see the 2.30.0 gdm-session-direct.c code.  Refer to the code that starts at line 529:

http://git.gnome.org/browse/gdm/tree/daemon/gdm-session-direct.c?id=GDM_2_30_0

Therefore, I suspect that the GDM code is being patched by your distro to read this key value, and the crashing bug is in their patch.  I would submit a patch to your distro's bug reporting system, since this does not seem to be a bug in the upstream GDM code.

I am closing this bug.  Please reopen if further research shows that there is indeed a problem in the upstream GDM code.
Comment 6 Sebastien Bacher 2010-06-09 16:24:20 UTC
the issue seems to be due to https://bugzilla.gnome.org/show_bug.cgi?id=607703