6

When my Xubuntu 18.04 laptop resumes from suspend, systemd-logind automatically logs out of the current session if the laptop has stayed suspended for more than a couple of hours. If the interval between suspend and resume is short, it doesn't log out. I still haven't discovered how long this interval has to be in order to cause the logout.

I enabled debug on the systemd-logind.service, creating file /etc/systemd/system/systemd-logind.service.d/10-debug.conf:

[Service]
Environment=SYSTEMD_LOG_LEVEL=debug

which causes systemd-logind to log all D-Bus messages it handles, but couldn't spot anything that might have caused the logout.

I scanned all systemd journal messages (journalctl) before systemd-logind starts killing the current session, investigated all that looked suspicious but couldn't find anything that might influence an automatic logout. Here are some of the messages that striked me as suspicious (they are not sequential, but pulled from different occasions):

upowerd[1600]: unhandled action 'unbind' on /sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0
polkitd(authority=local)[840]: Unregistered Authentication Agent for unix-session:c2 (system bus name :1.46, object path /org/gnome/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
wpa_supplicant[811]: dbus: fill_dict_with_properties dbus_interface=fi.w1.wpa_supplicant1.Interface dbus_property=Stations getter failed
wpa_supplicant[811]: dbus: wpa_dbus_get_object_properties: failed to get object properties: (none) none
at-spi-bus-launcher[7031]: XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
at-spi-bus-launcher[7031]:       after 30333 requests (30333 known processed) with 0 events remaining.
systemd-logind[779]: Inhibitor xfce4-power-manager (xfce4-power-manager handles these events) pid=8611 uid=1000 mode=block stopped
systemd-logind[779]: Electing new display for user paulo
systemd-logind[779]: Ignoring session c8

logind config doesn't have anything that might cause this:

paulo:~$ loginctl show-session
EnableWallMessages=no
NAutoVTs=6
KillUserProcesses=no
RebootToFirmwareSetup=no
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
BlockInhibited=handle-power-key:handle-suspend-key:handle-hibernate-key
DelayInhibited=sleep
InhibitDelayMaxUSec=5s
HandlePowerKey=poweroff
HandleSuspendKey=suspend
HandleHibernateKey=hibernate
HandleLidSwitch=suspend
HandleLidSwitchDocked=ignore
HoldoffTimeoutUSec=30s
IdleAction=ignore
IdleActionUSec=30min
PreparingForShutdown=no
PreparingForSleep=no
Docked=no
RemoveIPC=yes
RuntimeDirectorySize=615313408
InhibitorsMax=8192
NCurrentInhibitors=5
SessionsMax=8192
NCurrentSessions=1
UserTasksMax=10813

I can't find any anything that might cause an automatic logout after a time interval. I'm really stumped.

5
  • I'm seeing a seemingly similar symptom, of my session having ended after resuming from suspend. I see the same XIO: fatal IO error 11 (Resource temporarily unavailable) on X server in the logs on Debian unstable. May 21, 2018 at 18:58
  • @Novelocrat, I'm in doubt whether we should file a bug against systemd. I still don't know whether this is an expected feature that can be somehow configured, or a downright bug. I'd risk that this may be affecting more people, so hopefully they'll crash here with comments. If no solution pops up, I'll go ahead and file the bug. May 21, 2018 at 22:56
  • I filed a bug report on launchpad, let's see if that yields some solution. May 22, 2018 at 10:41
  • 2
    I'm starting to suspect systemd might not be the culprit: I found out a core file created at the time I resumed from suspend this morning. I didn't have xerver-xorg dbg symbols installed, so inspecting it with gdb only revealed: Core was generated by `/usr/lib/xorg/Xorg -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -noliste'. Program terminated with signal SIGBUS, Bus error. So it might be that, for a yet unknown reason, Xorg aborts on resuming from suspend, bringing down lightdm, and hence the logout. I've installed the xserver dbg symbols, and will keep an eye. May 22, 2018 at 15:48
  • 1
    Looks like my issue is somewhat different. I can resume from suspend right away, and my session will still be dead May 24, 2018 at 5:17

4 Answers 4

3

For intermittent X crash with SIGBUS on 18.04, please check this answer:

Ubuntu 18.04 error on waking up from sleep : Read-error on swap device

1
  • This is great ! So the X server was the symptom and not the cause. I've put the workaround in place and will monitor it. Then I'll test the patched kernel. Thank you so much for the pointer ! Jun 27, 2018 at 22:56
1

I have confirmed that this issue is caused by the Xorg server crashing with SIGBUS. Xorg server crashes and systemd-logind creates a new login session.

The Xorg server crashes because of an excessive number of requests from at-spi-bus-launcher. Right before each crash, messages such as these were logged on the systemd journal:

at-spi-bus-launcher[31720]: XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
at-spi-bus-launcher[31720]:       after 8065 requests (8065 known processed) with 0 events remaining.

It seems to be a documented issue, that Xorg crashes when it receives an excessive number of requests without interval.

To work around this bug, 2 steps are necessary:

  1. Uninstall package at-spi2-core
  2. Add export NO_AT_BRIDGE=1 to .profile, so that GTK applications don't complain about the absence of the accessibility bus

Xorg never crashed anymore after this workaround, and consequently there was no automatic logout anymore after resuming from suspend.

I filed a bug report against at-spi on the Gnome BugZilla.

1

When I think I nailed this issue, it bites me again :-(. The issue itself is indeed caused by the Xorg server crashing with SIGBUS, but the root cause of the crash is not at-spi-bus-launcher misbehaving. It shouldn't loop making those repeated requests, so the previous procedure is still valid, although it's not a workaround to the Xorg crash.

I discovered that Xorg was using kernel driver i915:

paulo:~$ sudo lshw -C video
  *-display
   description: VGA compatible controller
   product: 2nd Generation Core Processor Family Integrated Graphics Controller
   vendor: Intel Corporation
   physical id: 2
   bus info: pci@0000:00:02.0
   version: 09
   width: 64 bits
   clock: 33MHz
   capabilities: msi pm vga_controller bus_master cap_list rom
   configuration: driver=i915 latency=0
   resources: irq:36 memory:f6800000-f6bfffff memory:e0000000-efffffff ioport:f000(size=64) memory:c0000-dffff

So I tried another workaround, to force Xorg to use xserver-xorg-video-intel with acceleration method uxa, which is more stable than the default sna.

  1. Create directory /etc/X11/xorg.conf.d. We can place xorg.conf snippets in this directory, and the Xorg server picks them up when it starts.
  2. Create file /etc/X11/xorg.conf.d/10-intel.conf, directing Xorg to use its Intel video driver with acceleration method uxa.

Here's /etc/X11/xorg.conf.d/10-intel.conf:

Section "Device"
    Identifier "Intel Graphics"
    Driver "intel"
    Option "AccelMethod" "uxa"
EndSection

I have been using this workaround for 1 week and the Xorg server hasn't crashed, so I get the impression that it's the definitive workaround while Xorg isn't fixed.

I've opened a bug report against Xorg, which apparently seems to be affecting more users, since it was flagged as a duplicate of another bug, which I didn't detect at first since its title mentions another type of crash.

0

For those who are still facing this issue, here is my experience. Nvidia driver was the issue. On Linux Kernel version 5.0.0-27, "logout when resuming from suspend" started after I installed the Nvidia driver.

After a lot of failed "fixes" (listed here and elsewhere), I disabled the nvidia using the prime-select tool. And my laptop wakes up and restores session now. I have tested enabling/disabling nvidia and can safely conclude this is a workaround.

I'd still like to use nvidia though.

Here is the 10 lines before and after the said I/O Error-

Sep  4 15:11:44 rajesh gnome-session-binary[13674]: WARNING: App 

'org.gnome.SettingsDaemon.Wacom.desktop' exited with code 1
Sep  4 15:11:44 rajesh gnome-session[13674]: gnome-session-binary[13674]: WARNING: App 'org.gnome.SettingsDaemon.Power.desktop' exited with code 1
Sep  4 15:11:44 rajesh gnome-session-binary[13674]: WARNING: App 'org.gnome.SettingsDaemon.Power.desktop' exited with code 1
Sep  4 15:11:44 rajesh org.gnome.SettingsDaemon.XSettings.desktop[14715]: Cannot open display:
Sep  4 15:11:44 rajesh gnome-session[13674]: gnome-session-binary[13674]: WARNING: App 'org.gnome.SettingsDaemon.XSettings.desktop' exited with code 1
Sep  4 15:11:44 rajesh gnome-session-binary[13674]: WARNING: App 'org.gnome.SettingsDaemon.XSettings.desktop' exited with code 1
Sep  4 15:11:44 rajesh org.gnome.SettingsDaemon.Keyboard.desktop[14716]: Cannot open display:
Sep  4 15:11:44 rajesh gnome-session[13674]: gnome-session-binary[13674]: WARNING: App 'org.gnome.SettingsDaemon.Keyboard.desktop' exited with code 1
Sep  4 15:11:44 rajesh gnome-session-binary[13674]: WARNING: App 'org.gnome.SettingsDaemon.Keyboard.desktop' exited with code 1
Sep  4 15:11:45 rajesh kernel: [ 5497.467961] psmouse serio4: synaptics: queried max coordinates: x [..5664], y [..4682]
Sep  4 15:11:45 rajesh at-spi-bus-launcher[13209]: XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
Sep  4 15:11:45 rajesh at-spi-bus-launcher[13209]:       after 87 requests (87 known processed) with 0 events remaining.
Sep  4 15:11:45 rajesh gnome-shell[13755]: gnome-shell: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.
Sep  4 15:11:45 rajesh gnome-session[13674]: gnome-session-binary[13674]: WARNING: App 'org.gnome.Shell.desktop' exited with code 1
Sep  4 15:11:45 rajesh gnome-session-binary[13674]: WARNING: App 'org.gnome.Shell.desktop' exited with code 1
Sep  4 15:11:45 rajesh gsd-color[13835]: gsd-color: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.
Sep  4 15:11:45 rajesh gnome-session[13674]: gnome-session-binary[13674]: WARNING: App 'org.gnome.SettingsDaemon.Color.desktop' exited with code 1
Sep  4 15:11:45 rajesh gnome-session-binary[13674]: WARNING: App 'org.gnome.SettingsDaemon.Color.desktop' exited with code 1
Sep  4 15:11:45 rajesh gsd-color[8763]: failed to connect to device: Failed to connect to missing device /org/freedesktop/ColorManager/devices/xrandr_Goldstar_Company_Ltd_LG_ULTRAWIDE_122157_kanak_1000
Sep  4 15:11:45 rajesh gsd-color[8763]: failed to connect to device: Failed to connect to missing device /org/freedesktop/ColorManager/devices/xrandr_LG_Display_kanak_1000
Sep  4 15:11:45 rajesh org.gnome.SettingsDaemon.Color.desktop[14727]: Cannot open display:
Sep  4 15:11:45 rajesh gnome-session[13674]: gnome-session-binary[13674]: WARNING: App 'org.gnome.SettingsDaemon.Color.desktop' exited with code 1
Sep  4 15:11:45 rajesh gnome-session-binary[13674]: WARNING: App 'org.gnome.SettingsDaemon.Color.desktop' exited with code 1
Sep  4 15:11:45 rajesh gnome-shell[14724]: Failed to create backend: Unable to open display ':0'
Sep  4 15:11:45 rajesh gnome-session[13674]: gnome-session-binary[13674]: WARNING: App 'org.gnome.Shell.desktop' exited with code 1
Sep  4 15:11:45 rajesh gnome-session[13674]: gnome-session-binary[13674]: WARNING: App 'org.gnome.Shell.desktop' respawning too quickly

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .