Bug#895152: cinnamon-screensaver: cinnamon-screesaver-command only locks the screen the first time it is called

2022-08-05 Thread Fabio Fantoni
cinnamon-screensaver had important changes time ago and other 
improvements also in 5.4.1 
(https://github.com/linuxmint/cinnamon-screensaver/pull/410)


can someone test and tell me if the issue is still present in latest 
version please?




OpenPGP_signature
Description: OpenPGP digital signature


Bug#895152: cinnamon-screensaver: cinnamon-screesaver-command only locks the screen the first time it is called

2018-04-08 Thread Pitxyoki
Hi,

I could also reproduce with your simpler example.
Having this isolated to such simple cases was pretty hard for me, as
it was not clear where the root cause could be.

So, yes, this seems to be as you described and the two cases in this
report seem to be the same:
 * In the first case, I just wasn't waiting long enough for the
timeout to appear.
 * In the second case it makes sense that the stack traces only start
appearing after the 10th attempt as 30 seconds passed by then and
that's probably the "g-io-error-quark" timeout. So, the error doesn't
seem to be caused by some piling up of repeated requests in this case,
as I initially thought.

Note that this is similar to #895150 but in that one I expect the
command not to hang when it fails. In this, I'd expect this error not
to occur when the screensaver is already active. I suppose adding an
atomic check for a running screensaver before trying to launch it
should not be too hard.

Thanks and regards,
-- 
Luís Picciochi Oliveira



Bug#895152: cinnamon-screensaver: cinnamon-screesaver-command only locks the screen the first time it is called

2018-04-08 Thread Margarita Manterola
control: retitle -1 cinnamon-screensaver-command hungs if locking 
already locked screen


Hi,

I have been able to reproduce this issue.  I believe it's very similar 
to the other one you reported.


In my test, I waited long enough with the screen locked, that just one 
second call to cinnamon-screensaver-command failed:


marga@penelope:~$ date; cinnamon-screensaver-command -l; date; 
cinnamon-screensaver-command -l; date

dom abr  8 18:04:50 CEST 2018
dom abr  8 18:04:51 CEST 2018
Traceback (most recent call last):
  File 
"/usr/share/cinnamon-screensaver/cinnamon-screensaver-command.py", line 
73, in on_client_ready

self.perform_action()
  File 
"/usr/share/cinnamon-screensaver/cinnamon-screensaver-command.py", line 
90, in perform_action

self.client.proxy.call_lock_sync(self.message)
GLib.Error: g-io-error-quark: Se alcanzó el tiempo de expiración (24)

<... and it hungs there forever ...>

So, what I see happening here is that cinnamon-screensaver-command is 
trying to lock a screen that is already locked. It times out and then 
hungs, like when it can't lock because of a popup.  It's likely that 
this bug is the same as 895150. In other words, 
cinnamon-screensaver-command misbehaves when it fails to lock the 
screen, regardless of why it fails.


--
Regards,
Marga



Bug#895152: cinnamon-screensaver: cinnamon-screesaver-command only locks the screen the first time it is called

2018-04-07 Thread Luís Picciochi Oliveira
Package: cinnamon-screensaver
Version: 3.6.1-2
Severity: normal

Dear Maintainer,

Consider the following script:

  var=1
  while true ; do
sleep 3
echo Test number $var
date
cinnamon-screensaver-command -l --away-message "Test number $var"
date
echo 'The screensaver should have started...'
var=$((var+1));
  done

Running this, I would expect to ensure the screen is locked every 3 seconds.
In the case when the screensaver was already locked when `cinnamon-screensaver-
command -l` is called, I would expect the call to be harmless and return
without doing anything.

However, I see the following output:
Test number 1
Sat  7 Apr 20:52:48 WEST 2018
Sat  7 Apr 20:52:49 WEST 2018
The screensaver should have started... # (1)
Test number 2
Sat  7 Apr 20:52:52 WEST 2018 # (2)
Sat  7 Apr 20:53:02 WEST 2018 # (3)
The screensaver should have started...
^C

(1) tells me that cinnamon-screensaver-command was called and returned.
(2) talls me that we entered the second cycle. cinnamon-screensaver-command was
called (we saw "Test number 2" on the lock screen), but then it does not
return.
The timestamp in (3) is only printed after I enter my password at the locked
screen and press Enter. This tells us that the second call only returns after
the lock screen is dismissed.


I can't see a reason for the cinnamon-screensaver-command to return in the
first call but not in the second. This inconsistency makes it hard to script
more complex behaviours.


Possibly related to this, I also observed that if I send the cinnamon-
screensaver-command call to the background, by adding an '&' to the end of the
line:

  cinnamon-screensaver-command -l --away-message "Test number $var" &


...it will be able to call the command up to 9 times. Starting with the 10th,
the script will output a stack trace on all subsequent calls:

Test number 9
Sat  7 Apr 21:02:43 WEST 2018
[8] 31244
Sat  7 Apr 21:02:43 WEST 2018
The screensaver should have started...
Test number 10
Sat  7 Apr 21:02:46 WEST 2018
[9] 31257
Sat  7 Apr 21:02:46 WEST 2018
The screensaver should have started...
Traceback (most recent call last):
  File "/usr/share/cinnamon-screensaver/cinnamon-screensaver-command.py", line
73, in on_client_ready
self.perform_action()
  File "/usr/share/cinnamon-screensaver/cinnamon-screensaver-command.py", line
90, in perform_action
self.client.proxy.call_lock_sync(self.message)
GLib.Error: g-io-error-quark: Timeout was reached (24)
Test number 11
...

After closing the lock screen, killing the script and the pending commands, I
see that all but the first call were hanging in the background.
Why only after the 10th we start seeing tracebacks is also not clear to me.

I believe `cinnamon-screensaver-command -l` should:
 * always return
 * signal any errors with a non-zero return code
 * either lock the screen or do nothing at all if it was already locked.

Note that #895150 is related but more generic than this.

Thanks and best regards,
Luís Picciochi Oliveira



-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.15.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages cinnamon-screensaver depends on:
ii  cinnamon-desktop-data   3.6.2-2
ii  gir1.2-accountsservice-1.0  0.6.45-1
ii  gir1.2-cinnamondesktop-3.0  3.6.2-2
ii  gir1.2-gkbd-3.0 3.26.0-3
ii  gir1.2-glib-2.0 1.56.0-2
ii  gir1.2-gtk-3.0  3.22.29-2
ii  gir1.2-xapp-1.0 1.0.4-2
ii  iso-flags-png-320x240   1.0.1-1
ii  libc6   2.27-3
ii  libcscreensaver03.6.1-2
ii  libglib2.0-02.56.0-4
ii  libgtk-3-0  3.22.29-2
ii  python3 3.6.4-1
ii  python3-gi  3.28.1-1
ii  python3-gi-cairo3.28.1-1
ii  python3-setproctitle1.1.10-1+b1
ii  python3-xapp1.0.1-1
ii  python3-xlib0.20-3

Versions of packages cinnamon-screensaver recommends:
pn  cinnamon-screensaver-x-plugin  

Versions of packages cinnamon-screensaver suggests:
pn  cinnamon-screensaver-webkit-plugin  

-- no debconf information