Debugging Central

This page is part of the debugging series — pages with debugging details for a variety of Ubuntu packages.


Bugs relating to screen locking issues typically fall into 4 categories:

  1. Screensaver failing to start after the inactivity period times out
  2. Screensaver failing to start when triggered manually
  3. No password prompt after resuming from suspend/hibernation
  4. Screensaver not hiding desktop and applications properly

Screen locking is a complex combination of many different packages, applications, and tools. For detailed information on how screen locking works, see DebuggingScreenLocking/HowScreenLockingWorks.

How to file

The proper way to report a bug about screen locking is by using ubuntu-bug:

$ ubuntu-bug gnome-screensaver

This will open a bug and, starting with Lucid, will attach debugging information about gnome-screensaver.

The following command can be used to attach the required information to a bug that is already open:

$ apport-collect BUGNUMBER

It is very important to detail in the bug report the steps necessary to reproduce the issue in order for the developers to be able to fix it.

Extra information

  • What desktop environment does this problem occur in? (GNOME, XFCE, KDE, etc.)
  • Do you use visual effects? (System/Preferences/Appearance/Visual Effects)
  • Does the problem still occur if you disable visual effects?
  • Does the problem still occur if you use the "blank screen" screensaver?
  • Is the "Lock screen when screensaver is active" setting checked in System/Preferences/Screensaver?
  • Is this a laptop or a desktop machine?
  • How many monitors do you use?
  • If it is a laptop, do you use an external screen?
  • Do you have the hamster-applet application installed? This applications has been known to cause screen locking issues.

Getting GConf values

The following command will dump all the screen-locking relevant settings that are stored in GConf:

$ gconftool-2 --dump /apps/gnome-screensaver /apps/gnome-power-manager /desktop/gnome/session /desktop/gnome/lockdown > screen-locking-debug.xml

Getting a log from gnome-screensaver

The following command will make gnome-screensaver dump debugging information to a log file:

$ killall gnome-screensaver
$ gnome-screensaver --no-daemon --debug 2>&1 | tee ~/gnome-ss.log

Getting an xtrace log from gnome-screensaver

The following command will xtrace the gnome-screensaver process to a log file:

$ killall gnome-screensaver
$ xtrace -D:9 -d:0 -k 2>&1 | tee ~/xtrace-gss.log
$ DISPLAY=:9.0 gnome-screensaver

Debugging procedure

The following procedure can help in diagnosing screen locking issues:

  1. Check the gnome-screensaver preferences by starting System/Preferences/Screensaver. Make sure "Activate screensaver when computer is idle" is checked. Make sure "Lock screen when screensaver is idle" is checked. Make sure the slider is set to a reasonable amount of time, such as 5 minutes. Select "Blank screen" as the screensaver theme to make sure one of the themes is not making gnome-screensaver crash.
  2. Reboot the computer and log in.
  3. Check if the gnome-screensaver daemon is running either by using "ps" on the command line, or by using System/Administration/System Monitor and looking in the Processes tab. Make sure gnome-screensaver is running under your user. If gnome-screensaver is not running, screen locking will not work. You can use "gnome-screensaver --debug" on the command line to try and figure out why. You can also check to see if the /etc/xdg/autostart/gnome-screensaver.desktop file is there and is still enabled.
  4. Wait the required timeout without touching the keyboard and mouse, and without having any applications or menus open.
  5. If the screensaver does not come up after the timeout has passed, try and trigger it manually by pressing Ctrl-Alt-L, and by selecting "Lock Screen" from the Session menu.
  6. Check that gnome-screensaver is running (pidof gnome-screensaver)

  7. Check that gnome-power-manager is running (pidof gnome-power-manager)

  8. Check that gnome-session is running (pidof gnome-session)

  9. Check inhibition state of gnome-screensaver (gnome-screensaver-command --query)

  10. Check that indictor-applet-session is running (pidof indicator-applet-session)

  11. Check inhibition state of gnome-session (dbus-send --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager org.gnome.SessionManager.GetInhibitors or dbus-send --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager org.gnome.SessionManager.IsInhibited uint32:-1)

  12. Check if gnome-session changes presence (dbus-monitor --session "type='signal',interface='org.gnome.SessionManager.Presence',member='StatusChanged'" and wait for idle time)

  13. Check if manual activation of screensaving works (gnome-screensaver-command -a)

    1. If manual activation works, the idle timer may not be functioning, check the logs of gnome-screensaver itself directly:
      1. pkill gnome-screensaver

      2. gnome-screensaver --no-deamon --debug 2>&1 | tee ~/g-ss.log

Report any findings in your bug report.

How to Forward

If you think that a bug needs to be forwarding upstream, please have a look at Bugs/Upstream/GNOME where you can find instructions on how to do it.

Known bugs

List of known issues with gnome-screensaver:






screensaver doesn't start immediately after being enabled

When screensaver is activated with the control panel, it doesn't activate until system is rebooted.






gnome-screensaver not functioning

Inhibitors would not be cleaned up properly if the application that set them dropped off the bus.

List of known issues with compiz:






Desktop, Launcher and menu bar still visible when screen locked

Desktop, Launcher and menu bar still visible when screen locked

gnome-screensaver cannot grab keyboard or mouse

gnome-screensaver will not activate if an application grabs keyboard and mouse focus.

This happens most noticeably with GTK context menus. If a context or panel menu is open, it grabs the pointer and gnome-screensaver never activates. It is also an issue for applications such as VNC, virt-manager, VirtualBox, Remote Desktop Viewer, Terminal Server Client, gnome-keyring, password dialogs, etc.

This problem is quite difficult to solve and there is currently no solution to this issue.



screen doesn't lock when panel menu is open

try harder to break grabs

Does not activate screensaver if menu is open

Screen is shown, and then screensaver activates again

This is a known issue, stemming from the fact that gnome-screensaver will not activate if an application grabs keyboard and mouse focus.

What happens is the following: 1- Random application (such as vnc window, or gtk menu) grabs keyboard or mouse 2- Screensaver attemps to come up after timeout to lock screen, but cannot gain keyboard or mouse lock 3- Screen gets blanked from DPMS 4- User moves mouse, turning screen back on with DPMS, and sees desktop 5- Mouse movement has released keyboard or mouse lock 6- Screensaver can now grab keyboard and mouse, and locks the screen

This happens after inactivity, or when suspending a laptop while a problematic application is open.

There is no current solution for this problem. The screensaver needs to grab the keyboard and the mouse so keystrokes typed in the screensaver login box doesn't get sent to the underlying application.

The only solution for this problem is for X to gain a way of breaking locks on keyboard and mouse events.

gnome-screensaver under XFCE (xubuntu, mythbuntu)

Under a XFCE desktop (including xubuntu and mythbuntu), gnome-screensaver never activates after the idle timeout expires.

gnome-screensaver in Karmic and later uses gnome-session's idle signal, instead of using it's own idle watcher. Xubuntu doesn't use gnome-session, so gnome-screensaver doesn't work properly.



gnome-screensaver doesn't activate under XFCE

gnome-screensaver not activated

Reliance on gnome-session

gnome-screensaver authentication failure with a broken /dev/null device

Sometimes, gnome-screensaver will appear to unlock with any password, will not prompt for authentication information, or will not unlock with a correct password.

Examining the /var/log/auth.log file shows error similar to the following:

Apr 18 16:27:29 cw gnome-screensaver-dialog: pam_unix(gnome-screensaver:auth): unix_chkpwd abnormal exit: 11

This is caused by the /dev/null device having been replaced with a regular file. This can occur when a system administrator has specified "/dev/null" as the name of a log file for a system daemon thinking logs would get ignored. Instead, when log rotation occurs, the system daemon will erase the /dev/null device and create a regular file in its place. Doing "ls -l /dev/null" should display the following:

crw-rw-rw- 1 root root 1, 3 2010-04-17 13:28 /dev/null



unix_chkpwd crashes on gnome-screensaver

/dev/null corrupted (/dev/null.1)

gnome-screensaver authentication failure with incorrect /etc/shadow permissions

Sometimes, gnome-screensaver will not unlock with a correct password.

Examining the /var/log/auth.log file shows error similar to the following:

Jul 14 19:04:34 desktop unix_chkpwd[1760]: check pass; user unknown

This is caused by the /etc/shadow file having the wrong permissions. Doing "ls -l /etc/shadow" should display the following:

-rw-r----- 1 root shadow 1241 2010-08-22 12:43 /etc/shadow



Password does not unlock screen

Also see

CategoryBugSquad CategoryDebugging

DebuggingScreenLocking (last edited 2012-07-25 17:11:32 by mdeslaur)