You are not logged in.

#1 2017-05-10 06:20:44

hobarrera
Member
From: The Netherlands
Registered: 2011-04-12
Posts: 355
Website

Resuming from hibernation fails

When trying to resume from hibernation it always fails.

* It's never worked for me.
* No windows on this machine. Not now or ever.
* No other OS on this machine, actually.
* Using systemd-boot.

Command line:

initrd=\intel-ucode.img
initrd=\initramfs-linux.img
rd.luks.uuid=8374545b-2f4b-4092-a6dd-ddfba49adadc resume=UUID=4f728876-83e8-4af7-be24-56903b2c530c root=UUID=0d145bc4-d4d4-4be8-8227-fa73d8f47113 elevator=noop rw quiet acpi_osi="!Darwin" systemd.legacy_systemd_cgroup_controller=yes

Relevant lines from journalctl:

May 10 03:07:12 localhost kernel: PM: Starting manual resume from disk
May 10 03:07:12 localhost kernel: PM: Hibernation image partition 254:2 present
May 10 03:07:12 localhost kernel: PM: Looking for hibernation image.
May 10 03:07:12 localhost kernel: PM: Image signature found, resuming
May 10 03:07:12 localhost kernel: PM: Preparing processes for restore.
May 10 03:07:12 localhost kernel: Freezing user space processes ... (elapsed 0.001 seconds) done.
May 10 03:07:12 localhost kernel: PM: Loading hibernation image.
May 10 03:07:12 localhost kernel: PM: Marking nosave pages: [mem 0x00000000-0x00000fff]
May 10 03:07:12 localhost kernel: PM: Marking nosave pages: [mem 0x00058000-0x00058fff]
May 10 03:07:12 localhost kernel: PM: Marking nosave pages: [mem 0x000a0000-0x000fffff]
May 10 03:07:12 localhost kernel: PM: Marking nosave pages: [mem 0x66421000-0x66421fff]
May 10 03:07:12 localhost kernel: PM: Marking nosave pages: [mem 0x66421000-0x66421fff]
May 10 03:07:12 localhost kernel: PM: Marking nosave pages: [mem 0x78d01000-0x78d48fff]
May 10 03:07:12 localhost kernel: PM: Marking nosave pages: [mem 0x78d5d000-0x78d8efff]
May 10 03:07:12 localhost kernel: PM: Marking nosave pages: [mem 0x78e3a000-0x78e8efff]
May 10 03:07:12 localhost kernel: PM: Marking nosave pages: [mem 0x78ecc000-0x78efefff]
May 10 03:07:12 localhost kernel: PM: Marking nosave pages: [mem 0x78f88000-0x78fdefff]
May 10 03:07:12 localhost kernel: PM: Marking nosave pages: [mem 0x79000000-0xffffffff]
May 10 03:07:12 localhost kernel: PM: Basic memory bitmaps created
May 10 03:07:12 localhost kernel: PM: Using 3 thread(s) for decompression.
                                  PM: Loading and decompressing image data (245580 pages)...
May 10 03:07:12 localhost kernel: Hibernate inconsistent memory map detected!
May 10 03:07:12 localhost kernel: PM: Image mismatch: architecture specific data
May 10 03:07:12 localhost kernel: PM: Read 982320 kbytes in 0.01 seconds (98232.00 MB/s)
May 10 03:07:12 localhost kernel: PM: Error -1 resuming
May 10 03:07:12 localhost kernel: PM: Failed to load hibernation image, recovering.
May 10 03:07:12 localhost kernel: PM: Basic memory bitmaps freed
May 10 03:07:12 localhost kernel: Restarting tasks ... done.
May 10 03:07:12 localhost systemd-hibernate-resume[258]: Could not resume from '/dev/disk/by-uuid/4f728876-83e8-4af7-be24-56903b2c530c' (254:2).
May 10 03:07:12 localhost kernel: PM: Hibernation image not present or could not be loaded.
May 10 03:07:12 localhost systemd[1]: Started Resume from hibernation using device /dev/disk/by-uuid/4f728876-83e8-4af7-be24-56903b2c530c.
May 10 03:07:12 localhost systemd[1]: Reached target Local File Systems (Pre).

Swap should be more than enough (problem is resuming anyway):

$ free
              total        used        free      shared  buff/cache   available
Mem:       16310580     1053860    13998392      387716     1258328    14565156
Swap:      20975612           0    20975612

$ swapon
NAME      TYPE      SIZE USED PRIO
/dev/dm-2 partition  20G   0B   -1

$ sudo blkid /dev/dm-2
/dev/dm-2: UUID="4f728876-83e8-4af7-be24-56903b2c530c" TYPE="swap"

Offline

#2 2017-05-10 18:26:19

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: Resuming from hibernation fails

How are you hibernating? If you are using systemctl, then try pm-utils or vice-versa.

Your issue sounds similar to https://bugzilla.redhat.com/show_bug.cgi?id=1442601

Offline

#3 2017-05-16 13:38:47

hobarrera
Member
From: The Netherlands
Registered: 2011-04-12
Posts: 355
Website

Re: Resuming from hibernation fails

I was using systemctl to hibernate. I only just got a change to install pm-utils and try out pm-hibernate (since trying this means having to possibly lose my session, I've to make quite some to, plus, I was away for the weekend big_smile ).

Hibernating with pm-hibernate works, but after restarting Xorg crashes horribly.

May 16 10:31:23 athena.barrera.io systemd-coredump[1749]: Process 853 (Xorg) of user 1000 dumped core.
                                                          
                                                          Stack trace of thread 853:
                                                          #0  0x00007f8a9818ea10 raise (libc.so.6)
                                                          #1  0x00007f8a9819013a abort (libc.so.6)
                                                          #2  0x00007f8a981cd2b0 __libc_message (libc.so.6)
                                                          #3  0x00007f8a981d390e malloc_printerr (libc.so.6)
                                                          #4  0x00007f8a981d5d61 _int_malloc (libc.so.6)
                                                          #5  0x00007f8a981d806b __libc_calloc (libc.so.6)
                                                          #6  0x00007f8a949cdf20 n/a (intel_drv.so)
                                                          #7  0x00007f8a949e528c n/a (intel_drv.so)
                                                          #8  0x000000000051e7d7 n/a (Xorg)
                                                          #9  0x0000000000513dea n/a (Xorg)
                                                          #10 0x00000000004369e5 n/a (Xorg)
                                                          #11 0x000000000043a968 n/a (Xorg)
                                                          #12 0x00007f8a9817b511 __libc_start_main (libc.so.6)
                                                          #13 0x000000000042464a _start (Xorg)
                                                          
                                                          Stack trace of thread 857:
                                                          #0  0x00007f8a98247aa3 epoll_wait (libc.so.6)
                                                          #1  0x000000000059cb64 n/a (Xorg)
                                                          #2  0x000000000059a316 n/a (Xorg)
                                                          #3  0x00007f8a985062e7 start_thread (libpthread.so.0)
                                                          #4  0x00007f8a9824754f __clone (libc.so.6)

Offline

#4 2017-05-16 15:15:31

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: Resuming from hibernation fails

Is the swap partition encrypted?

Offline

#5 2017-05-16 16:34:54

hobarrera
Member
From: The Netherlands
Registered: 2011-04-12
Posts: 355
Website

Re: Resuming from hibernation fails

My disk is a LUKS encrypted partition, with LVM inside, which contains both the root and swap partitions.

Offline

#6 2017-05-16 19:11:26

seth
Member
Registered: 2012-09-03
Posts: 51,229

Offline

#7 2017-05-16 20:22:12

hobarrera
Member
From: The Netherlands
Registered: 2011-04-12
Posts: 355
Website

Re: Resuming from hibernation fails

Yup:

$ grep HOOKS /etc/mkinitcpio.conf
HOOKS="systemd autodetect modconf block keyboard sd-encrypt sd-lvm2 resume filesystems"

I don't think it's a misconfigured swap, because pm-hibernate de-hibernates okay (but Xorg immediately crashes).

Offline

#8 2017-05-16 21:35:30

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: Resuming from hibernation fails

Actually you should not add the resume hook if you use the systemd hook. The role of the resume hook is played by systemd-hibernate-resume-generator et. al. in that case. Though it might not be relevant to your problem.

Offline

#9 2017-05-16 22:42:43

hobarrera
Member
From: The Netherlands
Registered: 2011-04-12
Posts: 355
Website

Re: Resuming from hibernation fails

You're absolutely right, that hook is not needed. Removing the hooks makes systemd behave just like pm-hibernate:  it resumes and then Xorg immediately crashes.

So now I just need to understand why Xorg crashes.

Offline

#10 2017-05-16 23:26:33

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Resuming from hibernation fails

Can you post your xorg log from the crash.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#11 2017-05-16 23:35:54

hobarrera
Member
From: The Netherlands
Registered: 2011-04-12
Posts: 355
Website

Re: Resuming from hibernation fails

Yeah, resuming after hibernating with systemd stopped working. Now I'm wondering if it only worked that once, or if I'd screwed up testing:

May 16 20:32:13 localhost systemd[1]: Starting Resume from hibernation using device /dev/disk/by-uuid/4f728876-83e8-4af7-be24-56903b2c530c...
May 16 20:32:13 localhost kernel: PM: Starting manual resume from disk
May 16 20:32:13 localhost kernel: PM: Hibernation image partition 254:2 present
May 16 20:32:13 localhost kernel: PM: Looking for hibernation image.
May 16 20:32:13 localhost kernel: PM: Image signature found, resuming
May 16 20:32:13 localhost kernel: PM: Preparing processes for restore.
May 16 20:32:13 localhost kernel: Freezing user space processes ... (elapsed 0.001 seconds) done.
May 16 20:32:13 localhost kernel: PM: Loading hibernation image.
May 16 20:32:13 localhost kernel: PM: Marking nosave pages: [mem 0x00000000-0x00000fff]
May 16 20:32:13 localhost kernel: PM: Marking nosave pages: [mem 0x00058000-0x00058fff]
May 16 20:32:13 localhost kernel: PM: Marking nosave pages: [mem 0x000a0000-0x000fffff]
May 16 20:32:13 localhost kernel: PM: Marking nosave pages: [mem 0x66421000-0x66421fff]
May 16 20:32:13 localhost kernel: PM: Marking nosave pages: [mem 0x66421000-0x66421fff]
May 16 20:32:13 localhost kernel: PM: Marking nosave pages: [mem 0x78d01000-0x78d48fff]
May 16 20:32:13 localhost kernel: PM: Marking nosave pages: [mem 0x78d5d000-0x78d8efff]
May 16 20:32:13 localhost kernel: PM: Marking nosave pages: [mem 0x78e3a000-0x78e8efff]
May 16 20:32:13 localhost kernel: PM: Marking nosave pages: [mem 0x78ecc000-0x78efefff]
May 16 20:32:13 localhost kernel: PM: Marking nosave pages: [mem 0x78f88000-0x78fdefff]
May 16 20:32:13 localhost kernel: PM: Marking nosave pages: [mem 0x79000000-0xffffffff]
May 16 20:32:13 localhost kernel: PM: Basic memory bitmaps created
May 16 20:32:13 localhost kernel: PM: Using 3 thread(s) for decompression.
                                  PM: Loading and decompressing image data (299023 pages)...
May 16 20:32:13 localhost kernel: Hibernate inconsistent memory map detected!
May 16 20:32:13 localhost kernel: PM: Image mismatch: architecture specific data
May 16 20:32:13 localhost kernel: PM: Read 1196092 kbytes in 0.01 seconds (119609.20 MB/s)
May 16 20:32:13 localhost kernel: PM: Error -1 resuming
May 16 20:32:13 localhost kernel: PM: Failed to load hibernation image, recovering.
May 16 20:32:13 localhost kernel: PM: Basic memory bitmaps freed
May 16 20:32:13 localhost kernel: Restarting tasks ... done.
May 16 20:32:13 localhost kernel: PM: Hibernation image not present or could not be loaded.
May 16 20:32:13 localhost systemd-hibernate-resume[258]: Could not resume from '/dev/disk/by-uuid/4f728876-83e8-4af7-be24-56903b2c530c' (254:2).
May 16 20:32:13 localhost systemd[1]: Started Resume from hibernation using device /dev/disk/by-uuid/4f728876-83e8-4af7-be24-56903b2c530c.

Offline

#12 2017-07-10 12:31:54

eblau
Member
Registered: 2016-02-11
Posts: 43

Re: Resuming from hibernation fails

Any ideas on this issue? Did you ever get it fixed? I upgraded from linux-lts (4.9.36) to linux (4.11.9) and now I'm hitting the same problem. It's quite annoying to hit this on a laptop where you have a lot of programs running:

Jul 10 08:22:28 eric-macbookpro kernel: PM: Starting manual resume from disk
Jul 10 08:22:28 eric-macbookpro kernel: PM: Hibernation image partition 254:1 present
Jul 10 08:22:28 eric-macbookpro kernel: PM: Looking for hibernation image.
Jul 10 08:22:28 eric-macbookpro kernel: PM: Image signature found, resuming
Jul 10 08:22:28 eric-macbookpro kernel: PM: Preparing processes for restore.
Jul 10 08:22:28 eric-macbookpro kernel: Freezing user space processes ... (elapsed 0.001 seconds) done.
Jul 10 08:22:28 eric-macbookpro kernel: PM: Loading hibernation image.
Jul 10 08:22:28 eric-macbookpro kernel: PM: Marking nosave pages: [mem 0x00000000-0x00000fff]
Jul 10 08:22:28 eric-macbookpro kernel: PM: Marking nosave pages: [mem 0x00058000-0x00058fff]
Jul 10 08:22:28 eric-macbookpro kernel: PM: Marking nosave pages: [mem 0x000a0000-0x000fffff]
Jul 10 08:22:28 eric-macbookpro kernel: PM: Marking nosave pages: [mem 0x78445000-0x78445fff]
Jul 10 08:22:28 eric-macbookpro kernel: PM: Marking nosave pages: [mem 0x78445000-0x78445fff]
Jul 10 08:22:28 eric-macbookpro kernel: PM: Marking nosave pages: [mem 0x8ad01000-0x8ad48fff]
Jul 10 08:22:28 eric-macbookpro kernel: PM: Marking nosave pages: [mem 0x8ad61000-0x8ad8efff]
Jul 10 08:22:28 eric-macbookpro kernel: PM: Marking nosave pages: [mem 0x8ae3a000-0x8ae8efff]
Jul 10 08:22:28 eric-macbookpro kernel: PM: Marking nosave pages: [mem 0x8aecc000-0x8aefefff]
Jul 10 08:22:28 eric-macbookpro kernel: PM: Marking nosave pages: [mem 0x8afaa000-0x8afdefff]
Jul 10 08:22:28 eric-macbookpro kernel: PM: Marking nosave pages: [mem 0x8b000000-0xffffffff]
Jul 10 08:22:28 eric-macbookpro kernel: PM: Basic memory bitmaps created
Jul 10 08:22:28 eric-macbookpro kernel: PM: Using 3 thread(s) for decompression.
                                        PM: Loading and decompressing image data (792750 pages)...
Jul 10 08:22:28 eric-macbookpro kernel: Hibernate inconsistent memory map detected!
Jul 10 08:22:28 eric-macbookpro kernel: PM: Image mismatch: architecture specific data
Jul 10 08:22:28 eric-macbookpro kernel: PM: Read 3171000 kbytes in 0.01 seconds (317100.00 MB/s)
Jul 10 08:22:28 eric-macbookpro kernel: PM: Error -1 resuming
Jul 10 08:22:28 eric-macbookpro kernel: PM: Failed to load hibernation image, recovering.

I have a MacBook Pro 12,1 that has been working fine with hibernate from Linux kernel versions 4.4.x through 4.9.x. It stopped working with the kernel update to 4.10.x and 4.11.x hence the reason I stayed on linux-lts so far. Recently an annoying i915 crash was fixed in 4.11.x so I decided to upgrade but it looks like this hibernation bug has still not been fixed.

Anyone have any suggestions?

Last edited by eblau (2017-07-10 12:37:07)

Offline

#13 2017-07-10 12:49:24

seth
Member
Registered: 2012-09-03
Posts: 51,229

Offline

#14 2017-07-10 13:10:49

eblau
Member
Registered: 2016-02-11
Posts: 43

Re: Resuming from hibernation fails

seth wrote:

Thanks. I tried those suggestions but they did not work for me. Seems odd to try Windows OS identifiers on a MacBook Pro but I tried both acpi_osi suggestions in that post but made no difference.

Resume from hibernate worked perfectly for many months on kernels prior to 4.10 with the exception of the odd i915 module problem.

I do see some ACPI errors on boot. I have encrypted root and swap partitions and I see the following on boot:

Jul 10 09:00:15 eric-macbookpro kernel: ACPI: Disabled all _OSI OS vendors
Jul 10 09:00:15 eric-macbookpro kernel: ACPI: Added _OSI(Module Device)
Jul 10 09:00:15 eric-macbookpro kernel: ACPI: Added _OSI(Processor Device)
Jul 10 09:00:15 eric-macbookpro kernel: ACPI: Added _OSI(3.0 _SCP Extensions)
Jul 10 09:00:15 eric-macbookpro kernel: ACPI: Added _OSI(Processor Aggregator Device)
Jul 10 09:00:15 eric-macbookpro kernel: ACPI: Added _OSI(Darwin)
Jul 10 09:00:15 eric-macbookpro kernel: ACPI: Added _OSI('Windows)
Jul 10 09:00:15 eric-macbookpro kernel: ACPI : EC: EC started
Jul 10 09:00:15 eric-macbookpro kernel: ACPI : EC: interrupt blocked
Jul 10 09:00:15 eric-macbookpro kernel: ACPI: \: Used as first EC
Jul 10 09:00:15 eric-macbookpro kernel: ACPI: \: GPE=0x4e, EC_CMD/EC_SC=0x66, EC_DATA=0x62
Jul 10 09:00:15 eric-macbookpro kernel: ACPI: \: Used as boot ECDT EC to handle transactions
Jul 10 09:00:15 eric-macbookpro kernel: ACPI: BIOS _OSI(Darwin) query honored via DMI
Jul 10 09:00:15 eric-macbookpro kernel: ACPI: [Firmware Bug]: BIOS _OSI(Linux) query ignored
Jul 10 09:00:15 eric-macbookpro kernel: ACPI Error: Needed type [Reference], found [Integer] ffff88026485c900 (20170119/exresop-103)
Jul 10 09:00:15 eric-macbookpro kernel: ACPI Exception: AE_AML_OPERAND_TYPE, While resolving operands for [OpcodeName unavailable] (20
Jul 10 09:00:15 eric-macbookpro kernel: ACPI Error: Method parse/execution failed [\_PR.CPU0._PDC] (Node ffff8802660ee4b0), AE_AML_OPE
Jul 10 09:00:15 eric-macbookpro kernel: ACPI: Dynamic OEM Table Load:
Jul 10 09:00:15 eric-macbookpro kernel: ACPI: SSDT 0xFFFF880264EDA800 00067C (v01 PmRef  ApIst    00003000 INTL 20140424)
Jul 10 09:00:15 eric-macbookpro kernel: ACPI: Dynamic OEM Table Load:
Jul 10 09:00:15 eric-macbookpro kernel: ACPI: SSDT 0xFFFF880264FEBA00 000119 (v01 PmRef  ApCst    00003000 INTL 20140424)
Jul 10 09:00:15 eric-macbookpro kernel: ACPI : EC: EC stopped
Jul 10 09:00:15 eric-macbookpro kernel: ACPI : EC: EC started
Jul 10 09:00:15 eric-macbookpro kernel: ACPI : EC: interrupt blocked
Jul 10 09:00:15 eric-macbookpro kernel: ACPI: \_SB_.PCI0.LPCB.EC__: Used as first EC
Jul 10 09:00:15 eric-macbookpro kernel: ACPI: \_SB_.PCI0.LPCB.EC__: GPE=0x4e, EC_CMD/EC_SC=0x66, EC_DATA=0x62
Jul 10 09:00:15 eric-macbookpro kernel: ACPI: \_SB_.PCI0.LPCB.EC__: Used as boot DSDT EC to handle transactions
Jul 10 09:00:15 eric-macbookpro kernel: ACPI: Interpreter enabled
Jul 10 09:00:15 eric-macbookpro kernel: ACPI: (supports S0 S3 S4 S5)
Jul 10 09:00:15 eric-macbookpro kernel: ACPI: Using IOAPIC for interrupt routing

Offline

#15 2017-07-10 17:23:31

eblau
Member
Registered: 2016-02-11
Posts: 43

Re: Resuming from hibernation fails

Reverting the following commit and building my own kernel has fixed the problem for me. I am now able to hibernate and resume successfully as I was prior to 4.10:

commit 62a03defeabd58f74e07ca030d6c21e069d4d88e
Author: Chen Yu <yu.c.chen@intel.com>
Date:   Thu Oct 20 16:14:52 2016 +0800

    PM / hibernate: Verify the consistent of e820 memory map by md5 digest

I will follow up with the linux-kernel mailing list. Every bug report I've seen so far has involved filesystems encrypted with LUKS so I wonder if there is some connection there. The commit message mentions a caveat that can cause the consistency check added in the above commit to fail:

    2. Another case is, this patch replies on comparing the e820_saved, but
       currently the e820_save might not be strictly the same across
       hibernation, even if BIOS has provided consistent e820 map - In
       theory mptable might modify the BIOS-provided e820_saved dynamically
       in early_reserve_e820_mpc_new, which would allocate a buffer from
       E820_RAM, and marks it from E820_RAM to E820_RESERVED).
       This is a potential and rare case we need to deal with in OS in
       the future.

Offline

#16 2017-08-21 21:37:45

eblau
Member
Registered: 2016-02-11
Posts: 43

Re: Resuming from hibernation fails

I found a safer way to be able to resume my MacBook Pro 12,1 from hibernate rather than removing safeties from the kernel.

I installed the systemd-suspend-modules package from the AUR and added the "facetimehd" and "brcmfmac" modules to /etc/suspend-modules.conf. This causes these modules to be removed on suspend or hibernate and reloaded on resume. This took care of most of the issues for me.

The only other two things I do is to make sure I have all Thunderbolt and USB devices removed before I hibernate and before I resume. If I don't, sometimes the resume fails with the error above about architecture specific data changing. Also, I had to mess with /proc/acpi/wakeup to disable XHCI1, ARPT, and LID0 from waking up my laptop. I found that with these devices enabled for wakeup, sometimes my laptop would randomly wake up out of suspend or hibernate or immediately reboot after I try to hibernate.

With these changes, I've been able to reliably suspend, hibernate, and resume with kernel 4.12.6 and 4.12.8.

Offline

#17 2017-08-21 21:39:55

eblau
Member
Registered: 2016-02-11
Posts: 43

Re: Resuming from hibernation fails

BTW, I did play around with the 'acpi_osi' kernel boot option. I disassembled the ACPI DSDT and found that it recognizes 'Darwin', 'Linux', 'Windows 2009', and 'Windows 2012' as valid OS names, but setting 'acpi_osi' to recognize my MacBook Pro as running those different OSes made no difference as to whether I could resume from hibernate or not.

Offline

Board footer

Powered by FluxBB