DebuggingKernelHibernate

Differences between revisions 1 and 2
Revision 1 as of 2014-01-22 12:11:16
Size: 8906
Editor: penalvch
Comment: Created dedicated Hibernate article, as a dedicated suspend article already exists.
Revision 2 as of 2014-09-01 17:15:57
Size: 7547
Editor: penalvch
Comment: Reorg'ed the presentation to streamline what is requested from original reporters. Very little content change.
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
= Triage and Debug of Kernel Hibernate Resume apport bugs = = Introduction =
Line 6: Line 6:
This page is aimed to help you do initial triage and debug of hibernate/resume bugs as reported by apport. This page presents some background information as to how the reporting works, and then will take you through a series of debug steps recommending information and data which will need to be collected. This page is to help you debug and triage hibernate/resume bugs. The two types of reports are those generated via apport, and manually reported via ubuntu-bug linux. For apport reports, apport checks at boot time whether there was a hibernate in progress, if the computer boots normally then it never resumed and therefore failed. This means that the failure may have occurred some time before the report is generated. Bear this in mind when debugging and triaging.
Line 8: Line 8:
The primary source of reports of hibernate failures arrive via apport. Apport checks at boot time whether there was a hibernate in progress, if we are booting normally then that was never resumed and therefore has failed. This means that the failure may have occurred some time before the report is generated. Bear this in mind when answering the questions below.

== Bug Validation ==

Before gathering information on the bug you could consider the questions in this section which will help weed out false reports and duplicates.

=== Is this really a failure? ===

If it is the case where the user has an encrypted swap, hibernation will currently fail. This is a known issue. See below for more information.

=== Is this a repetition of a previous failure? ===

If this is another occurrence of a previous reported failure it is best to mark the new bug a duplicate of the first using the Mark Duplicate link on the bug report.

== Information Gathering ==

At a very minimum every hibernate/resume bug should contain the answers the questions in this section before being considered [[https://wiki.ubuntu.com/Bugs/Status|Triaged|target="https://wiki.ubuntu.com/Bugs/Status"]].

=== Did the machine break while going into hibernation or waking up? ===

It is very important to know whether the problem occurs on the way into the hibernation state or on the way out. If the machine never makes it to hibernate, but instead wakes up or powers off incorrectly, that is a hibernate failure. If the machine wakes back up from hibernate but then takes you to the login prompt or crashes after that then it is a resume failure.

Please indicate in the bug whether it is a hibernate or wakeup failure and how you determined this.

=== Is it reproducible? ===

Is the problem reproducible. If you do say 10 hibernate cycles does the problem occur every time, 1 in 5 etc. Do the symptoms vary at all?

Please indicate in the bug how and what you tested.

=== Did it work before? ===

Has this hibernate ever worked in the past. If it has which kernel release did it work on?

Please indicate in the bug whether it worked, and if so include the contents of /proc/version_signature from that release (or the Ubuntu version number if you do not have it).

=== Do you end up with flashing Caps Lock light or similar? ===

If you have a flashing Caps Lock light then very likely you are experiencing a kernel panic.

Please indicate that in the bug.

=== Hibernate specific information ===

For resume from Hibernate failures, please include the output from the following commands from the boot following the hibernate, this includes information on the search for the resume device etc:

 1. {{{dmesg}}}
 1. {{{cat /proc/cmdline}}}
 1. {{{cat /etc/initramfs-tools/conf.d/resume}}}

=== Other information ===

Please include any information as to the circumstances leading up to this failure, anything unusual for example did you see any error messages?

= Debugging Hibernate =
= Known issues =
Line 68: Line 14:
Users installing from Ubuntu 9.10 and selecting the Encrypted Home option will automatically have encrypted swap space. Other users may have also ran sudo ecryptfs-setup-swap. It is important to note that Hibernation will work with an encrypted swap but resume will fail. There are ways around this, but they involve choosing a password to use for your encrypted swap and entering that password every time you boot your system, and sharing that password with anyone else that might want to resume the system. This is a known, wishlist [[https://bugs.launchpad.net/ecryptfs/+bug/432785|issue|target="https://bugs.launchpad.net/ecryptfs/+bug/432785"]] that we hope to solve. If you happen to report or triage this type of issue, please tag the bug '''encrypted-swap'''. For triagers, posting the following comment to a bug may help: Users installing and selecting the Encrypted Home option will automatically have encrypted swap space. Other users may have also ran sudo ecryptfs-setup-swap. It is important to note that hibernation will work with an encrypted swap but resume from hibernation will fail. There are ways around this, but they involve choosing a password to use for your encrypted swap and entering that password every time you boot your system, and sharing that password with anyone else that might want to resume the system. This is a known, wishlist [[https://bugs.launchpad.net/ecryptfs/+bug/432785|issue|target="https://bugs.launchpad.net/ecryptfs/+bug/432785"]] that we hope to solve. If you happen to report or triage this type of issue, please tag the bug '''encrypted-swap'''. For triagers, posting the following comment to a bug may help:
Line 70: Line 16:

= Information to provide in a bug report =

At a minimum every hibernate/resume report should contain responses to each item in this section before being considered [[https://wiki.ubuntu.com/Bugs/Status|Triaged|target="https://wiki.ubuntu.com/Bugs/Status"]].

 1. Is this really a failure?
  * If it is the case where the user has an encrypted swap, hibernation will currently fail as previously noted.
 1. Is it reproducible? If not, how often would it be reproducible?
 1. Did it work before on a prior kernel in the same release, or prior release?
 1. Do the symptoms vary at all between hibernation attempts? For example, one time WiFi didn't work, but another a kernel error shows on the screen.
 1. Do you end up with a flashing Caps Lock light?
  * If you have a flashing Caps Lock light then very likely you are experiencing a kernel panic.
 1. Please advise on how the computer hibernated, and resumed specifically. For example:
  * Executing at a terminal pm-hibernate
  * Shutting the lid of your laptop, which is set to hibernate on close.
  * Clicking the word Hibernate in the GUI.
  * The computer hibernated automatically on inactivity.
 1. Did the machine break while going into hibernation or waking up?
  * It is very important to know whether the problem occurs on the way into the hibernation state or on the way out. If the machine never makes it to hibernate, but instead wakes up or powers off incorrectly, that is a hibernate failure. If the machine wakes back up from hibernate but then takes you to the login prompt or crashes after that then it is a resume failure.
 1. Did you see any error messages leading up to the failure?
 1. For resume from hibernate failures, please include the output from the following commands from the boot following the hibernate, this includes information on the search for the resume device, etc.:
  * {{{dmesg}}}
  * {{{cat /proc/cmdline}}}
  * {{{cat /etc/initramfs-tools/conf.d/resume}}}
 1. The information as applicable below.
Line 74: Line 45:
Line 79: Line 49:
Common method is to take photos of the screen and attach the dmesg output to the bug report.
Line 80: Line 51:
This will select a much smaller font so that you can see more messages should they come out, and then initate the hibernate. == Dead, blank, or black screen on resume ==
In some cases, a machine can hibernate just fine, and resume without issue, with the exception of waking up to a blacked-out screen. In other words, the computer is running just fine, but the display appears dead. One thing to try is disabling Kernel Mode Setting. One may do this by editing the grub configuration: {{{
     sudo nano /etc/default/grub
}}}
Line 82: Line 56:
To help us investigate the problem please use the following debug test method and report results in the bug. Common method is to take photos of the screen & attach dmesg output to the bug report. Find the line reading: {{{
     GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
}}}

Add {{{nomodeset}}} to the end, inside the quotes: {{{
     GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"
}}}

Exit from nano and save the file. Make grub aware of the new changes: {{{
     update-grub2
}}}

When that exits, reboot the computer normally, then test hibernate. This change will persist across reboots unless you explicitly revert it. In some cases, this will also fix another issue where the screen doesn't dim after a period of inactivity like it should, assuming it is otherwise configured to do so in your desktop environment.
Line 86: Line 72:
Again from VT-1 (see above for instructions), first reduce the size of your font with the following commands:

{{{
Again from VT1 (see above for instructions), first reduce the size of your font with the following commands: {{{
Line 93: Line 77:
    * "devices" test mode in "platform" mode of hibernation
    * "core" test mode in "platform" mode of hibernation
    * "core test mode in "reboot" mode of hibernation.
 * "devices" test mode in "platform" mode of hibernation.
 * "core" test mode in "platform" mode of hibernation.
 * "core test mode in "reboot" mode of hibernation.
Line 98: Line 82:
    * core :
           t
est the freezing of processes, suspending of devices, platform global
          
control methods(*), the disabling of nonboot CPUs and suspending of
           platform/system devices
    
* devices :
           t
est the freezing of processes and suspending of devices
 * core: Test the freezing of processes, suspending of devices, platform global control methods(*), the disabling of nonboot CPUs and suspending of platform/system devices.
 * devices: Test the freezing of processes and suspending of devices.
Line 105: Line 85:
If you `cat /sys/power/pm_test` and `cat /sys/power/disk` it will list the modes that it supports. Performing `cat /sys/power/pm_test` and `cat /sys/power/disk` will list the modes that it supports.
Line 107: Line 87:
Then run the following commands: Then run the following commands: {{{
sudo -i
Line 109: Line 90:
     {{{
$ sudo -i
lsmod > lsmod.output.txt
Line 112: Line 92:
# lsmod > lsmod.output.txt echo devices > /sys/power/pm_test
echo platform > /sys/power/disk
echo disk > /sys/power/state
dmesg > /tmp/dmesg-devices-platform.txt
Line 114: Line 97:
# echo devices > /sys/power/pm_test
# echo platform > /sys/power/disk
# echo disk > /sys/power/state
# dmesg > /tmp/dmesg-devices-platform.txt
echo core > /sys/power/pm_test
echo platform > /sys/power/disk
echo disk > /sys/power/state
dmesg > /tmp/dmesg-core-platform.txt
Line 119: Line 102:
# echo core > /sys/power/pm_test
# echo platform > /sys/power/disk
# echo disk > /sys/power/state
# dmesg > /tmp/dmesg-core-platform.txt

# echo core > /sys/power/pm_test
#
echo reboot > /sys/power/disk
# echo disk > /sys/power/state
# dmesg > /tmp/dmesg-core-reboot.txt
echo core > /sys/power/pm_test
echo reboot > /sys/power/disk
echo disk > /sys/power/state
dmesg > /tmp/dmesg-core-reboot.txt
Line 134: Line 112:
= Dead, Blank, or Black Screen on Resume =

In some cases, a machine can hibernate just fine, and resume without issue, with the exception of waking up to a blacked-out screen. In other words, the computer is running just fine, but the display appears dead. If nothing else in this article solves that issue, or the text above just doesn't apply to your particular setup, one may try disabling Kernel Mode Setting.

Edit your grub configuration:

{{{
     sudo nano /etc/default/grub
}}}

Find the line reading:

{{{
     GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
}}}

Add {{{nomodeset}}} to the end, inside the quotes:

{{{
     GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"
}}}

Exit from nano and save the file. Make grub aware of the new changes:

{{{
     update-grub2
}}}

When that exits, reboot the computer normally, then test hibernate. This change will persist across reboots unless you explicitly revert it. In some cases, this will also fix another issue where the screen doesn't dim after a period of inactivity like it should, assuming it is otherwise configured to do so in your desktop environment

= See also =
 * [[KernelTeam/SuspendResumeTesting]]

Introduction

This page is to help you debug and triage hibernate/resume bugs. The two types of reports are those generated via apport, and manually reported via ubuntu-bug linux. For apport reports, apport checks at boot time whether there was a hibernate in progress, if the computer boots normally then it never resumed and therefore failed. This means that the failure may have occurred some time before the report is generated. Bear this in mind when debugging and triaging.

Known issues

Failure due to encrypted swap

https://help.ubuntu.com/community/EncryptedHome

Users installing and selecting the Encrypted Home option will automatically have encrypted swap space. Other users may have also ran sudo ecryptfs-setup-swap. It is important to note that hibernation will work with an encrypted swap but resume from hibernation will fail. There are ways around this, but they involve choosing a password to use for your encrypted swap and entering that password every time you boot your system, and sharing that password with anyone else that might want to resume the system. This is a known, wishlist issue that we hope to solve. If you happen to report or triage this type of issue, please tag the bug encrypted-swap. For triagers, posting the following comment to a bug may help:

Thank you for taking the time to report this bug and helping to make Ubuntu better. It is currently a known issue that Hibernation will fail to resume due to an encrypted swap. Please refer to https://help.ubuntu.com/community/EncryptedHome for more information. We will tag this bug "encrypted-swap" so that we can track this issue going forward and possibly request additional testing. Thanks in advance for your patience and cooperation.

Information to provide in a bug report

At a minimum every hibernate/resume report should contain responses to each item in this section before being considered Triaged.

  1. Is this really a failure?
    • If it is the case where the user has an encrypted swap, hibernation will currently fail as previously noted.
  2. Is it reproducible? If not, how often would it be reproducible?
  3. Did it work before on a prior kernel in the same release, or prior release?
  4. Do the symptoms vary at all between hibernation attempts? For example, one time WiFi didn't work, but another a kernel error shows on the screen.

  5. Do you end up with a flashing Caps Lock light?
    • If you have a flashing Caps Lock light then very likely you are experiencing a kernel panic.
  6. Please advise on how the computer hibernated, and resumed specifically. For example:
    • Executing at a terminal pm-hibernate
    • Shutting the lid of your laptop, which is set to hibernate on close.
    • Clicking the word Hibernate in the GUI.
    • The computer hibernated automatically on inactivity.
  7. Did the machine break while going into hibernation or waking up?
    • It is very important to know whether the problem occurs on the way into the hibernation state or on the way out. If the machine never makes it to hibernate, but instead wakes up or powers off incorrectly, that is a hibernate failure. If the machine wakes back up from hibernate but then takes you to the login prompt or crashes after that then it is a resume failure.
  8. Did you see any error messages leading up to the failure?
  9. For resume from hibernate failures, please include the output from the following commands from the boot following the hibernate, this includes information on the search for the resume device, etc.:
    • dmesg

    • cat /proc/cmdline

    • cat /etc/initramfs-tools/conf.d/resume

  10. The information as applicable below.

Hibernating from text mode

The first step for debugging hibernate is to determine if the issue occurs when triggered using the pm-hibernate command. If possible you should reboot the system with the no_console_suspend boot parameter. See DebuggingKernelBoot for instructions on how to modify boot parameters. You should then switch to VT1 by pressing Ctrl-Alt-F1. Login at the prompt there and then run the following commands:

setfont /usr/share/consolefonts/Uni1-VGA8.psf.gz
sudo pm-hibernate

Common method is to take photos of the screen and attach the dmesg output to the bug report.

Dead, blank, or black screen on resume

In some cases, a machine can hibernate just fine, and resume without issue, with the exception of waking up to a blacked-out screen. In other words, the computer is running just fine, but the display appears dead. One thing to try is disabling Kernel Mode Setting. One may do this by editing the grub configuration:

     sudo nano /etc/default/grub

Find the line reading:

     GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

Add nomodeset to the end, inside the quotes:

     GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"

Exit from nano and save the file. Make grub aware of the new changes:

     update-grub2

When that exits, reboot the computer normally, then test hibernate. This change will persist across reboots unless you explicitly revert it. In some cases, this will also fix another issue where the screen doesn't dim after a period of inactivity like it should, assuming it is otherwise configured to do so in your desktop environment.

Per sub-system hibernate testing

Again from VT1 (see above for instructions), first reduce the size of your font with the following commands:

setfont /usr/share/consolefonts/Uni1-VGA8.psf.gz

There are three tests listed below:

  • "devices" test mode in "platform" mode of hibernation.
  • "core" test mode in "platform" mode of hibernation.
  • "core test mode in "reboot" mode of hibernation.

The test modes are as follows:

  • core: Test the freezing of processes, suspending of devices, platform global control methods(*), the disabling of nonboot CPUs and suspending of platform/system devices.
  • devices: Test the freezing of processes and suspending of devices.

Performing cat /sys/power/pm_test and cat /sys/power/disk will list the modes that it supports.

Then run the following commands:

sudo -i

lsmod > lsmod.output.txt

echo devices > /sys/power/pm_test
echo platform > /sys/power/disk
echo disk > /sys/power/state
dmesg > /tmp/dmesg-devices-platform.txt

echo core > /sys/power/pm_test
echo platform > /sys/power/disk
echo disk > /sys/power/state
dmesg > /tmp/dmesg-core-platform.txt

echo core > /sys/power/pm_test
echo reboot > /sys/power/disk
echo disk > /sys/power/state
dmesg > /tmp/dmesg-core-reboot.txt

Please collect the lsmod, full dmesg output files from the failing boot/tests, and attach to the bug report. This includes significant information about the search for the resume device.

Please report whether you got any additional messages. Digital photos of the screen are a sensible way to get this into the bug.


CategoryKernel CategoryDebugging

DebuggingKernelHibernate (last edited 2016-12-27 21:20:01 by penalvch)