Locking from user menu fails second time (gnome-screensaver SimulateUserActivity() doesn't return)

Bug #1067515 reported by Tim Lunn on 2012-10-16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
GNOME Screensaver
Fix Released
gnome-screensaver (Ubuntu)

Bug Description

Locking and other actions are delayed when used for a second time

Test Case:
1. Login
2. Lock screen from system menu, then unlock
3. Lock screen again from system menu

This time the lock dialog takes around 30secs to be displayed. At this point The same applies for Log-out, suspend options etc, if these are clicked instead of Lock in step #3.

Regression Potential:
The SimulateUserActivity method from gnome-screensaver could not function as it should resulting on the lock screen ui not being displayed after locking screen of the session indicator (it would still be there but would require an user action to show)

Tim Lunn (darkxst) wrote :
Tim Lunn (darkxst) wrote :

Actually appears something is hanging around after unlocking, that blocks indicator session for a bit. If you wait a few minutes between unlock and locking again (or log-out etc), the lock screen appears without delay.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in indicator-session (Ubuntu):
status: New → Confirmed
Jason Conti (jconti) wrote :

Don't think this is a bug in indicator-session. Basically indicator-session is just calling two dbus methods on org.gnome.ScreenSaver; Lock and SimulateUserActivity. It seems that the SimulateUserActivity call is not returning immediately. I can illustrate this with a simple script:


dbus-send --session --print-reply --dest=org.gnome.ScreenSaver \
  /org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock
dbus-send --session --print-reply --dest=org.gnome.ScreenSaver \
  /org/gnome/ScreenSaver org.gnome.ScreenSaver.SimulateUserActivity

which when run, locks the screen and then shows the lock screen immediately. When you unlock the screen, the script will still be blocked until the timeout is reached, where we get:

method return sender=:1.79 -> dest=:1.103 reply_serial=2
Error org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

The first line is from the successful call to Lock. The call to SimulateUserActivity is also successful since the lock screen appears immediately, but we never get a reply.

A decent workaround might be to set the timeout to some low value, say 1 second. It seems to work when setting --reply-timeout=1 in the script, I'm going to try rebuilding indicator-session with that value and see if it helps (though I am curious why we never get a reply).

Jason Conti (jconti) wrote :

Seems to fix it here, attaching a debdiff with the workaround. Curious if this is due to some change in dbus, I know quantal included at least the eavesdropping changes (though I would think we should be able to get the reply to our own method call).

The attachment "indicator-session_reply_timeout_workaround.debdiff" of this bug report has been identified as being a patch in the form of a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch

Thanks for the debugging Jason, I wonder if that makes it a gnome-screensaver bug then, it seems like SimulateUserActivity should give a reply...

Changed in indicator-session (Ubuntu):
importance: Undecided → Low
status: Confirmed → Triaged
Changed in gnome-screensaver (Ubuntu Quantal):
status: New → Triaged
importance: Undecided → Low
Sebastien Bacher (seb128) wrote :

interesting, calling SimulateUserActivity() in d-feet leads to block the ui as well, really looking like a gnome-screensaver issue...

summary: - Locking from user menu fails second time
+ Locking from user menu fails second time (g-s SimulateUserActivity
+ doesn't return)
summary: - Locking from user menu fails second time (g-s SimulateUserActivity
- doesn't return)
+ Locking from user menu fails second time (gnome-screensaver
+ SimulateUserActivity() doesn't return)
Sebastien Bacher (seb128) wrote :

Ok, looking a bit to it, doing:

dbus-send --session --print-reply --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver org.gnome.ScreenSaver.SimulateUserActivity

blocks on the current code

The patch there "fixes" the issue, I'm not sure it's right though, I would appreciate comments of people knowing that code better than me :-)

Changed in indicator-session:
status: New → Invalid
Changed in indicator-session (Ubuntu Quantal):
status: Triaged → Invalid
description: updated
Changed in gnome-screensaver (Ubuntu Quantal):
status: Triaged → In Progress
Sebastien Bacher (seb128) wrote :

Ok, after IRC discussion that seems right, I've forward to https://bugzilla.gnome.org/show_bug.cgi?id=686400 and will upload

Changed in gnome-screensaver:
importance: Unknown → Medium
status: Unknown → Fix Released

Hello Tim, or anyone else affected,

Accepted gnome-screensaver into quantal-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/gnome-screensaver/3.6.0-0ubuntu2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in gnome-screensaver (Ubuntu Quantal):
status: In Progress → Fix Committed
tags: added: verification-needed
Tim Lunn (darkxst) wrote :

Tested with package from -proposed, this issue is now resolved!

tags: added: verification-done
removed: verification-needed

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-screensaver - 3.6.0-0ubuntu2

gnome-screensaver (3.6.0-0ubuntu2) quantal-proposed; urgency=low

  * debian/patches/28_blocking_return.patch:
    - Correctly reply so the client doesn't block waiting (lp: #1067515)
 -- Sebastien Bacher <email address hidden> Thu, 18 Oct 2012 19:35:19 +0200

Changed in gnome-screensaver (Ubuntu):
status: Triaged → Fix Released
Changed in gnome-screensaver (Ubuntu Quantal):
status: Fix Committed → Fix Released
Omer Akram (om26er) on 2012-11-06
no longer affects: indicator-session (Ubuntu)
no longer affects: indicator-session (Ubuntu Quantal)
no longer affects: indicator-session
Øyvind Stegard (oyvinst) wrote :

The following dbus calls seem to no longer work (e.g. screensaver is not deactivated or timeout reset):
$ dbus-send --session --type=method_call --dest=org.gnome.ScreenSaver / org.gnome.ScreenSaver.SimulateUserActivity
$ dbus-send --session --type=method_call --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver org.gnome.ScreenSaver.SimulateUserActivity

(two different object paths, since it looks like object path has changed to /, at least according to d-feet dbus debugger).

Also, "xdg-screensaver suspend <wid>" does not seem to work either. It uses the second call above to keep screensaver from activating.

gnome-screensaver 3.6.0-0ubuntu2.1, Ubuntu 12.10.

Does the SimulateUserActivity work for anyone else ? I cannot figure out what's wrong.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.