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 749404 - gdm crashes after user session exits unclean
gdm crashes after user session exits unclean
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
3.16.x
Other Linux
: Normal minor
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2015-05-14 23:38 UTC by Christian Stadelmann
Modified: 2015-07-02 14:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
session-record: support NULL display name if tty available (for logout/failed) (5.10 KB, patch)
2015-07-01 11:47 UTC, Ray Strode [halfline]
none Details | Review

Description Christian Stadelmann 2015-05-14 23:38:38 UTC
Every time the user session crashes gdm will crash too. See this backtrace:

  • #0 __strncpy_sse2_unaligned
    at ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S line 296
  • #1 strncpy
    at /usr/include/bits/string3.h line 126
  • #2 record_set_id
    at gdm-session-record.c line 134
  • #3 gdm_session_record_logout
    at gdm-session-record.c line 292
  • #4 add_session_record
    at gdm-manager.c line 1101
  • #5 on_user_session_exited
    at gdm-manager.c line 2144

The user session exited with some problem thus session id is empty. This results in a SEGV. See https://bugzilla.redhat.com/show_bug.cgi?id=1214916 for detailled backtrace and additional info.

Since gnome/wayland session does something different (I don't understand what) compared to gnome/X11 session it always causes gdm to crash on logout (using Fedora 22).
Comment 1 Sinclair Yeh 2015-06-30 20:43:22 UTC
Seeing this in a VMWare guest, too.  I think in add_session_record(), this check should be "||" instead of "&&"


if (display_name == NULL && display_device == NULL) {
    goto out;
}
Comment 2 Sinclair Yeh 2015-06-30 20:49:23 UTC
(In reply to Sinclair Yeh from comment #1)
> Seeing this in a VMWare guest, too.  I think in add_session_record(), this
> check should be "||" instead of "&&"
> 
> 
> if (display_name == NULL && display_device == NULL) {
>     goto out;
> }

Actually, strike that.  The issue is gdm_session_record_logout() is not checking x11_display_name before using it.  Perhaps there should be a check like the one at the beginning of gdm_session_record_login()
Comment 3 Ray Strode [halfline] 2015-07-01 11:46:42 UTC
yea, totally.  I goofed on that one.
Comment 4 Ray Strode [halfline] 2015-07-01 11:47:10 UTC
Created attachment 306483 [details] [review]
session-record: support NULL display name if tty available (for logout/failed)

wayland sessions don't necessarily have a display name, so this
commit just uses the display device instead.

It's like commit 1edb0e4ae897cb1c53af3f3b2b913d5baf731580 but for
logout and failed records.

Discovered by Sinclair Yeh <syeh@vmware.com>
Comment 5 Ray Strode [halfline] 2015-07-01 11:48:10 UTC
Attachment 306483 [details] pushed as 29ecdb3 - session-record: support NULL display name if tty available (for logout/failed)
Comment 6 Sinclair Yeh 2015-07-01 14:58:07 UTC
The patch looks good to me.

Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Comment 7 Michael Catanzaro 2015-07-02 00:32:27 UTC
This looks like a good candidate for a backport?
Comment 8 Ray Strode [halfline] 2015-07-02 14:01:43 UTC
indeed, i'm overdue for a 3.16 release anyway, doing one now