# Suspend-to-ram resume is crashing

## Massimo B.

Hi,

suspend-to-ram stopped working some months ago. Also kernels known to be working are not working anymore, so I expect some change in the userspace being the culprit.

The resume first looks fine, it resumes from sleep, requesting the xscreensaver password, returns to the Xfce window manager with everything fine. Then after some seconds it starts to kill processes. The panels loose their decoration style, then the audio-mixer is crashing, then the panels are crashing, then after a few seconds the machine is just dark and shut down without a shutdown procedure.

By the way that issue only happens with X server running. suspend-to-ram works fine without the xdm service started.

I switched the syslogger to synchronous mode and tried to get as much of the kernel log as possible, I tried to separate the stages by comments:

```
### Suspend to Ram (S3) works at suspend, but after resuming, the machine looks good so far, requesting password in locker xscreensaver, a few seconds later the audio-mixer is crashing, then panels of Xfce are crashing, then 2-3 seconds later, the machine is powered off without halt procedure as if AC Powerbutton would have been pressed.

### STARTING to Suspend

Sep 13 08:40:27 [init] Switching to runlevel: 0

Sep 13 08:40:27 [NetworkManager] <info>  [1505284827.0156] manager: sleep requested (sleeping: no  enabled: yes)

Sep 13 08:40:27 [NetworkManager] <info>  [1505284827.0156] manager: sleeping...

Sep 13 08:40:27 [NetworkManager] <info>  [1505284827.0157] device (wlo1): state change: unavailable -> unmanaged (reason 'sleeping', internal state 'managed')

Sep 13 08:40:27 [NetworkManager] <info>  [1505284827.0158] device (wlo1): set-hw-addr: reset MAC address to 00:24:D7:DB:0D:C0 (unmanage)

Sep 13 08:40:27 [NetworkManager] <info>  [1505284827.0160] manager: NetworkManager state is now ASLEEP

Sep 13 08:40:27 [NetworkManager] <info>  [1505284827.0162] device (eth0): state change: activated -> deactivating (reason 'sleeping', internal state 'managed')

Sep 13 08:40:27 [dbus] [system] Activating service name='org.freedesktop.nm_dispatcher' (using servicehelper)

Sep 13 08:40:27 [NetworkManager] <info>  [1505284827.0173] device (eth0): state change: deactivating -> disconnected (reason 'sleeping', internal state 'managed')

Sep 13 08:40:27 [dbus] [system] Successfully activated service 'org.freedesktop.nm_dispatcher'

Sep 13 08:40:27 [nm-dispatcher] req:1 'connectivity-change': new request (1 scripts)

Sep 13 08:40:27 [nm-dispatcher] req:1 'connectivity-change': start running ordered scripts...

Sep 13 08:40:27 [NetworkManager] <info>  [1505284827.0332] dhcp4 (eth0): canceled DHCP transaction, DHCP client pid 7215

Sep 13 08:40:27 [NetworkManager] <info>  [1505284827.0333] dhcp4 (eth0): state changed bound -> done

Sep 13 08:40:27 [nm-dispatcher] req:2 'down' [eth0]: new request (1 scripts)

Sep 13 08:40:27 [NetworkManager] <info>  [1505284827.0357] device (eth0): state change: disconnected -> unmanaged (reason 'sleeping', internal state 'managed')

Sep 13 08:40:27 [nm-dispatcher] req:2 'down' [eth0]: start running ordered scripts...

Sep 13 08:40:27 [kernel] e1000e: eth0 NIC Link is Down

Sep 13 08:40:28 [sshd] Received signal 15; terminating.

Sep 13 08:40:28 [root] Shorewall Stopped

Sep 13 08:40:34 [kernel] Freezing user space processes ... (elapsed 0.001 seconds) done.

Sep 13 08:40:34 [kernel] OOM killer disabled.

Sep 13 08:40:34 [kernel] Freezing remaining freezable tasks ... (elapsed 0.000 seconds) done.

Sep 13 08:40:34 [kernel] Suspending console(s) (use no_console_suspend to debug)

Sep 13 08:40:34 [kernel] sd 6:0:0:0: [sdc] Synchronizing SCSI cache

Sep 13 08:40:34 [kernel] sd 1:0:0:0: [sdb] Synchronizing SCSI cache

Sep 13 08:40:34 [kernel] sd 0:0:0:0: [sda] Synchronizing SCSI cache

Sep 13 08:40:34 [kernel] sd 0:0:0:0: [sda] Stopping disk

Sep 13 08:40:34 [kernel] sd 1:0:0:0: [sdb] Stopping disk

Sep 13 08:40:34 [kernel] serial 00:04: disabled

Sep 13 08:40:34 [kernel] e1000e: EEE TX LPI TIMER: 00000011

Sep 13 08:40:34 [kernel] iwlwifi 0000:25:00.0: RF_KILL bit toggled to enable radio.

Sep 13 08:40:34 [kernel] PM: suspend of devices complete after 866.195 msecs

Sep 13 08:40:34 [kernel] PM: late suspend of devices complete after 0.359 msecs

Sep 13 08:40:34 [kernel] ehci-pci 0000:00:1d.0: System wakeup enabled by ACPI

Sep 13 08:40:34 [kernel] ehci-pci 0000:00:1a.0: System wakeup enabled by ACPI

Sep 13 08:40:34 [kernel] pcieport 0000:00:1c.7: System wakeup enabled by ACPI

Sep 13 08:40:34 [kernel] PM: noirq suspend of devices complete after 13.289 msecs

Sep 13 08:40:34 [kernel] ACPI: Preparing to enter system sleep state S3

Sep 13 08:40:34 [kernel] ACPI : EC: event blocked

Sep 13 08:40:34 [kernel] ACPI : EC: EC stopped

Sep 13 08:40:34 [kernel] PM: Saving platform NVS memory

Sep 13 08:40:34 [kernel] Disabling non-boot CPUs ...

Sep 13 08:40:34 [kernel] Removed affinity for 511 processes to cpu 1

Sep 13 08:40:34 [kernel] smpboot: CPU 1 is now offline

Sep 13 08:40:34 [kernel] Removed affinity for 511 processes to cpu 2

Sep 13 08:40:34 [kernel] smpboot: CPU 2 is now offline

Sep 13 08:40:34 [kernel] Removed affinity for 510 processes to cpu 3

Sep 13 08:40:34 [kernel] smpboot: CPU 3 is now offline

Sep 13 08:40:34 [kernel] ACPI: Low-level resume complete

### Suspend finished, STARTING Resume...

Sep 13 08:40:34 [kernel] ACPI : EC: EC started

Sep 13 08:40:34 [kernel] PM: Restoring platform NVS memory

Sep 13 08:40:34 [kernel] Enabling non-boot CPUs ...

Sep 13 08:40:34 [kernel] x86: Booting SMP configuration:

Sep 13 08:40:34 [kernel] smpboot: Booting Node 0 Processor 1 APIC 0x1

Sep 13 08:40:34 [kernel]  cache: parent cpu1 should not be sleeping

Sep 13 08:40:34 [kernel] Added affinity for 361 processes to cpu 1

Sep 13 08:40:34 [kernel] CPU1 is up

Sep 13 08:40:34 [kernel] smpboot: Booting Node 0 Processor 2 APIC 0x2

Sep 13 08:40:34 [kernel]  cache: parent cpu2 should not be sleeping

Sep 13 08:40:34 [kernel] Added affinity for 361 processes to cpu 2

Sep 13 08:40:34 [kernel] CPU2 is up

Sep 13 08:40:34 [kernel] smpboot: Booting Node 0 Processor 3 APIC 0x3

Sep 13 08:40:34 [kernel]  cache: parent cpu3 should not be sleeping

Sep 13 08:40:34 [kernel] Added affinity for 361 processes to cpu 3

Sep 13 08:40:34 [kernel] Released forced binding to cpu0 for 361 processes

Sep 13 08:40:34 [kernel] CPU3 is up

Sep 13 08:40:34 [kernel] ACPI: Waking up from system sleep state S3

Sep 13 08:40:34 [kernel] ehci-pci 0000:00:1d.0: System wakeup disabled by ACPI

Sep 13 08:40:34 [kernel] pcieport 0000:00:1c.7: System wakeup disabled by ACPI

Sep 13 08:40:34 [kernel] ehci-pci 0000:00:1a.0: System wakeup disabled by ACPI

Sep 13 08:40:34 [kernel] PM: noirq resume of devices complete after 21.894 msecs

Sep 13 08:40:34 [kernel] PM: early resume of devices complete after 0.296 msecs

Sep 13 08:40:34 [kernel] ACPI : EC: event unblocked

Sep 13 08:40:34 [kernel] ACPI : button: The lid device is not compliant to SW_LID.

Sep 13 08:40:34 [kernel] rtc_cmos 00:03: System wakeup disabled by ACPI

Sep 13 08:40:34 [kernel] sd 1:0:0:0: [sdb] Starting disk

Sep 13 08:40:34 [kernel] sd 0:0:0:0: [sda] Starting disk

Sep 13 08:40:34 [kernel] serial 00:04: activated

Sep 13 08:40:34 [kernel] [drm] enabling PCIE gen 2 link speeds, disable with radeon.pcie_gen2=0

Sep 13 08:40:34 [kernel] [drm] PCIE GART of 1024M enabled (table at 0x0000000000162000).

Sep 13 08:40:34 [kernel] radeon 0000:01:00.0: WB enabled

Sep 13 08:40:34 [kernel] radeon 0000:01:00.0: fence driver on ring 0 use gpu addr 0x0000000040000c00 and cpu addr 0xffff880429826c00

Sep 13 08:40:34 [kernel] radeon 0000:01:00.0: fence driver on ring 3 use gpu addr 0x0000000040000c0c and cpu addr 0xffff880429826c0c

Sep 13 08:40:34 [kernel] radeon 0000:01:00.0: fence driver on ring 5 use gpu addr 0x0000000000072118 and cpu addr 0xffffc90000632118

Sep 13 08:40:34 [kernel] [drm] ring test on 0 succeeded in 2 usecs

Sep 13 08:40:34 [kernel] [drm] ring test on 3 succeeded in 9 usecs

Sep 13 08:40:34 [kernel] [drm] ring test on 5 succeeded in 2 usecs

Sep 13 08:40:34 [kernel] [drm] UVD initialized successfully.

Sep 13 08:40:34 [kernel] [drm] ib test on ring 0 succeeded in 0 usecs

Sep 13 08:40:34 [kernel] [drm] ib test on ring 3 succeeded in 0 usecs

Sep 13 08:40:34 [kernel] ata4: SATA link down (SStatus 0 SControl 300)

Sep 13 08:40:34 [kernel] ata6: SATA link down (SStatus 0 SControl 300)

Sep 13 08:40:34 [kernel] ata5: SATA link down (SStatus 0 SControl 300)

Sep 13 08:40:34 [kernel] [drm] ib test on ring 5 succeeded

Sep 13 08:40:34 [kernel] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

Sep 13 08:40:34 [kernel] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected by device (Stat=0x51 Err=0x04)

                - Last output repeated twice -

Sep 13 08:40:34 [kernel] ata1.00: configured for UDMA/133

Sep 13 08:40:34 [kernel] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)

Sep 13 08:40:34 [kernel] ata2.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected by device (Stat=0x51 Err=0x04)

                - Last output repeated twice -

Sep 13 08:40:34 [kernel] ata2.00: configured for UDMA/100

Sep 13 08:40:34 [NetworkManager] <info>  [1505284834.9486] manager: rfkill: WiFi now enabled by radio killswitch

Sep 13 08:40:34 [kernel] OOM killer enabled.

Sep 13 08:40:34 [ntpd] Deleting interface #2 eth0, 10.190.226.74#123, interface stats: received=30, sent=30, dropped=0, active_time=1506 secs

Sep 13 08:40:34 [ntpd] 10.190.225.43 local addr 10.190.226.74 -> <null>

Sep 13 08:40:34 [root] ACPI event unhandled: jack/lineout LINEOUT unplug

Sep 13 08:40:34 [kernel] Restarting tasks ... done.

### ACPI errors:

Sep 13 08:40:35 [root] ACPI event unhandled: ac_adapter ACPI0003:00 00000080 00000001

Sep 13 08:40:35 [root] ACPI event unhandled: jack/videoout VIDEOOUT unplug

Sep 13 08:40:35 [laptop-mode] enabled, not active

Sep 13 08:40:35 [root] ACPI event unhandled: processor LNXCPU:00 00000081 00000000

Sep 13 08:40:35 [root] ACPI event unhandled: processor LNXCPU:01 00000081 00000000

Sep 13 08:40:35 [root] ACPI event unhandled: processor LNXCPU:02 00000081 00000000

Sep 13 08:40:35 [root] ACPI event unhandled: processor LNXCPU:03 00000081 00000000

Sep 13 08:40:35 [NetworkManager] <info>  [1505284835.1027] manager: wake requested (sleeping: yes  enabled: yes)

Sep 13 08:40:35 [NetworkManager] <info>  [1505284835.1027] manager: waking up...

Sep 13 08:40:35 [NetworkManager] <info>  [1505284835.1028] device (eth0): state change: unmanaged -> unavailable (reason 'managed', internal state 'managed')

Sep 13 08:40:35 [pkexec] pam_unix(polkit-1:session): session opened for user root by (uid=4728)

Sep 13 08:40:35 [pkexec] mb: Executing command [USER=root] [TTY=unknown] [CWD=/] [COMMAND=/usr/sbin/xfpm-power-backlight-helper --set-brightness 235]

Sep 13 08:40:35 [NetworkManager] <info>  [1505284835.2460] device (wlo1): state change: unmanaged -> unavailable (reason 'managed', internal state 'managed')

Sep 13 08:40:35 [kernel] iwlwifi 0000:25:00.0: L1 Enabled - LTR Disabled

                - Last output repeated twice -

Sep 13 08:40:35 [kernel] iwlwifi 0000:25:00.0: Radio type=0x0-0x3-0x1

Sep 13 08:40:35 [kernel] iwlwifi 0000:25:00.0: L1 Enabled - LTR Disabled

                - Last output repeated twice -

Sep 13 08:40:35 [kernel] iwlwifi 0000:25:00.0: Radio type=0x0-0x3-0x1

Sep 13 08:40:35 [NetworkManager] <info>  [1505284835.5679] device (wlo1): set-hw-addr: set MAC address to E6:7D:D8:29:70:34 (scanning)

Sep 13 08:40:35 [kernel] iwlwifi 0000:25:00.0: L1 Enabled - LTR Disabled

                - Last output repeated twice -

Sep 13 08:40:35 [kernel] iwlwifi 0000:25:00.0: Radio type=0x0-0x3-0x1

Sep 13 08:40:35 [/etc/init.d/openrc-settingsd] /etc/init.d/openrc-settingsd uses runscript, please convert to openrc-run.

### Why is ntpd terminating?

Sep 13 08:40:35 [ntpd] ntpd exiting on signal 15 (Terminated)

Sep 13 08:40:35 [/etc/init.d/rpc.idmapd] start-stop-daemon: no matching processes found

Sep 13 08:40:35 [/etc/init.d/rpc.pipefs] ERROR: rpc.pipefs failed to stop

Sep 13 08:40:35 [kernel] iwlwifi 0000:25:00.0: L1 Enabled - LTR Disabled

                - Last output repeated twice -

Sep 13 08:40:35 [kernel] iwlwifi 0000:25:00.0: Radio type=0x0-0x3-0x1

Sep 13 08:40:35 [NetworkManager] <info>  [1505284835.8789] manager: NetworkManager state is now DISCONNECTED

Sep 13 08:40:35 [laptop-mode] Failed to re-set power saving mode for wireless card

Sep 13 08:40:35 [NetworkManager] <info>  [1505284835.8942] sup-iface[0x2401b60,wlo1]: supports 5 scan SSIDs

Sep 13 08:40:35 [NetworkManager] <info>  [1505284835.8950] device (wlo1): supplicant interface state: starting -> ready

Sep 13 08:40:35 [NetworkManager] <info>  [1505284835.8950] device (wlo1): state change: unavailable -> disconnected (reason 'supplicant-available', internal state 'managed')

### Why is fcrond and others terminating?

Sep 13 08:40:35 [fcron] SIGTERM signal received

Sep 13 08:40:36 [fcron] Exiting with code 0

Sep 13 08:40:36 [cachefilesd] Daemon Terminated_

Sep 13 08:40:36 [kernel] CacheFiles: File cache on dm-2 unregistering

Sep 13 08:40:36 [kernel] FS-Cache: Withdrawing cache "mycache"

Sep 13 08:40:36 [/etc/init.d/rpcbind] start-stop-daemon: no matching processes found

Sep 13 08:40:37 [/etc/init.d/acpid] start-stop-daemon: no matching processes found

Sep 13 08:40:37 [NetworkManager] <info>  [1505284837.0385] caught SIGTERM, shutting down normally.

Sep 13 08:40:37 [NetworkManager] <info>  [1505284837.0396] device (wlo1): state change: disconnected -> unmanaged (reason 'unmanaged', internal state 'managed')

Sep 13 08:40:37 [NetworkManager] <info>  [1505284837.0490] device (wlo1): set-hw-addr: reset MAC address to 00:24:D7:DB:0D:C0 (unmanage)

Sep 13 08:40:37 [NetworkManager] <info>  [1505284837.0498] exiting (success)

### This was the last message before shutdown, next starting the machine again:

Sep 13 08:42:39 [kernel] ACPI: PM-Timer IO Port: 0x408

Sep 13 08:42:39 [kernel] ACPI: LAPIC_NMI (acpi_id[0x00] high edge lint[0x1])

Sep 13 08:42:39 [kernel] ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1])

Sep 13 08:42:39 [kernel] ACPI: LAPIC_NMI (acpi_id[0x02] high edge lint[0x1])

Sep 13 08:42:39 [kernel] ACPI: LAPIC_NMI (acpi_id[0x03] high edge lint[0x1])

Sep 13 08:42:39 [kernel] ACPI: LAPIC_NMI (acpi_id[0x04] high edge lint[0x1])

Sep 13 08:42:39 [kernel] ACPI: LAPIC_NMI (acpi_id[0x05] high edge lint[0x1])

Sep 13 08:42:39 [kernel] ACPI: LAPIC_NMI (acpi_id[0x06] high edge lint[0x1])

Sep 13 08:42:39 [kernel] ACPI: LAPIC_NMI (acpi_id[0x07] high edge lint[0x1])

Sep 13 08:42:39 [kernel] IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23
```

----------

## LIsLinuxIsSogood

Sep 13 08:40:34 [kernel] OOM killer enabled.

I think that's your answer to why some of the processes may be term'tdLast edited by LIsLinuxIsSogood on Sun Sep 24, 2017 6:52 am; edited 1 time in total

----------

## LIsLinuxIsSogood

```
Sep 13 08:40:34 [kernel] ACPI : EC: event unblocked 

 Sep 13 08:40:34 [kernel] ACPI : button: The lid device is not compliant to SW_LID. 

 Sep 13 08:40:34 [kernel] rtc_cmos 00:03: System wakeup disabled by ACPI
```

This seems to be something that is documented in other places. As well, just a quick search about it, online, seems like your user space kernel mode might need to be included in the hook for "button" this kernel module.  Can you check to see if that is a module you can simply remove and add back?  Like in this example from different forum...https://bbs.archlinux.org/viewtopic.php?id=226302

----------

## Massimo B.

 *LIsLinuxIsSogood wrote:*   

> Sep 13 08:40:34 [kernel] OOM killer enabled.
> 
> I think that's your answer to why some of the processes may be term'td

 

Ok, and who triggered that beast?

 *LIsLinuxIsSogood wrote:*   

> 
> 
> ```
> Sep 13 08:40:34 [kernel] ACPI : EC: event unblocked 
> 
> ...

 

But this thread is about a wrong LID status, that should never crash the rest of the system.

----------

## LIsLinuxIsSogood

I get that it is a problem with the lid.  That much I got.  But I think my response would have been more helpful had I phrased it as a question.  The kernel may be still built wrong.  Not sure, just because it works with xdm deactivated doesn't mean it works all the time.  That could be a kernel configuration issue, as much as it could be something else, like the X configuration on your system or the config for whatever pm utility you are using.  

Could you post some more information for that?  I assume it is either pm-utils or consolekit with pm-utils activated.

Also, if you haven't yet tried with another Desktop session manager, then doing so would help to know if the problem persists with other session managers?

I'm not really sure what else you are looking for in terms of do you care more to know the answer to why things seem to be going crazy on your computer, or to find a workaround?  It is not uncommon with power system due to the number of potential hooks for services and freezing states of memory that you would find an answer if you went that route.  Otherwise look to the potential for a kernel patch to correct all possible angles of your resume from S3 suspend on that particular hardware.

But since PM deals heavily with hardware and software it is appropriate to post some more info about the pm software utility in use and the system info (emerge --info).

----------

## Massimo B.

My current setup, migrated over years and maybe outdated if there are better

tools today:

```
app-laptop/laptop-mode-tools-1.71

sys-power/acpid-2.0.28

sys-power/pm-quirks-20100619

sys-power/pm-utils-1.4.1-r7

sys-power/upower-0.99.6

xfce-extra/xfce4-power-manager-1.6.0-r1
```

----------

## LIsLinuxIsSogood

Have you tried typing in something like 'xfce4-power-manager bugs lid' into a google search?  EDIT: Please Disregard this question

Also, please post the output of emerge --info xfce4-power-manager, if possible...I forget if you mentioned already that you running openRc correct?  Or is it systemd with PAM?

EDIT: Can you check in the BIOS as well to make sure it is up to date, you said the system was migrated...perhaps just a simple reinstall of one of the packages, like xfce4-power-manager --with-bdeps=y

----------

