Bug#951000: xfce4-panel: constant CPU consumption when displaying logout menu

2020-10-18 Thread Bernhard Übelacker
Dear Maintainer,
could reproduce this inside a minimal amd64 qemu VM in current testing.
In my test Xorg consumed on CPU completely, another thread 
xfce4/panel/wrapper-2.0
used 6% when this menu is opened.

It looked like this process triggers redrawing in a fast loop, which
seem most expensive on Xorg side.

Another thing that might be related is this logging message that is
constructed but never appears in any logfile as I see:


#0  __vasprintf_internal (result_ptr=result_ptr@entry=0x7ffd775615b0, 
format=0x7fe32cafc6e8 "State %u for %s %p doesn't match state %u set via 
gtk_style_context_set_state ()", format@entry=0x7ffd775615b0 "", 
args=0x7ffd775615d8, mode_flags=mode_flags@entry=2) at vasprintf.c:34
...
#5  0x7fe32c1274dd in g_log_structured_standard 
(log_domain=log_domain@entry=0x7fe32ca94047 "Gtk", 
log_level=log_level@entry=G_LOG_LEVEL_DEBUG, file=file@entry=0x7fe32cafc740 
"../../../../gtk/gtkstylecontext.c", line=, func=, message_format=) at ../../../glib/gmessages.c:1976
#6  0x7fe32c990a64 in gtk_style_context_push_state 
(context=context@entry=0x5601349a9150, state=state@entry=GTK_STATE_FLAG_NORMAL) 
at ../../../../gtk/gtkstylecontext.c:525
...


Kind regards,
Bernhard


# Bullseye/testing amd64 qemu VM 2020-10-18


apt update
apt dist-upgrade


apt install systemd-coredump mc htop psmisc net-tools gdb xfce4 
libxfce4panel-2.0-4-dbgsym libglib2.0-0-dbgsym xserver-xorg-core-dbgsym 
libpixman-1-0-dbgsym libgtk-3-0-dbgsym libx11-6-dbgsym libxcb1-dbgsym linux-perf
apt build-dep libxfce4panel-2.0-4


reboot


mkdir /home/benutzer/source/libxfce4panel-2.0-4/orig -p
cd/home/benutzer/source/libxfce4panel-2.0-4/orig
apt source libxfce4panel-2.0-4
cd


# Login
# Open "User menu"


taskset -pc 14 542
taskset -pc 15 876


root@debian:~# ps aux | grep -E "^USER|876|542"
USER PID %CPU %MEMVSZ   RSS TTY  STAT START   TIME COMMAND
root 542 27.6  2.9 2628860 90952 tty7Rsl+ 21:54  10:10 
/usr/lib/xorg/Xorg :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp 
vt7 -novtswitch
benutzer 876  1.4  5.9 203028 182108 ?   Sl   21:54   0:31 
/usr/lib/x86_64-linux-gnu/xfce4/panel/wrapper-2.0 
/usr/lib/x86_64-linux-gnu/xfce4/panel/plugins/libactions.so 14 14680075 actions 
Aktionsknöpfe Abmelden, sperren oder andere Systemaktionen


perf record -p 876 -g
perf report


(gdb) bt
#0  __vasprintf_internal (result_ptr=result_ptr@entry=0x7ffd775615b0, 
format=0x7fe32cafc6e8 "State %u for %s %p doesn't match state %u set via 
gtk_style_context_set_state ()", format@entry=0x7ffd775615b0 "", 
args=0x7ffd775615d8, mode_flags=mode_flags@entry=2) at vasprintf.c:34
#1  0x7fe32c016238 in __vasprintf_chk 
(result_ptr=result_ptr@entry=0x7ffd775615b0, flag=flag@entry=1, 
format=format@entry=0x7ffd775615b0 "", ap=) at vasprintf_chk.c:36
#2  0x7fe32c16c47f in vasprintf (__ap=, __fmt=0x7ffd775615b0 
"", __ptr=0x7ffd775615b0) at /usr/include/x86_64-linux-gnu/bits/stdio2.h:213
#3  g_vasprintf (string=string@entry=0x7ffd775615b0, format=, 
args=args@entry=0x7ffd775615d8) at ../../../glib/gprintf.c:337
#4  0x7fe32c13f95d in g_strdup_vprintf (format=, 
args=args@entry=0x7ffd775615d8) at ../../../glib/gstrfuncs.c:519
#5  0x7fe32c1274dd in g_log_structured_standard 
(log_domain=log_domain@entry=0x7fe32ca94047 "Gtk", 
log_level=log_level@entry=G_LOG_LEVEL_DEBUG, file=file@entry=0x7fe32cafc740 
"../../../../gtk/gtkstylecontext.c", line=, func=, message_format=) at ../../../glib/gmessages.c:1976
#6  0x7fe32c990a64 in gtk_style_context_push_state 
(context=context@entry=0x5601349a9150, state=state@entry=GTK_STATE_FLAG_NORMAL) 
at ../../../../gtk/gtkstylecontext.c:525
#7  0x7fe32c991761 in gtk_style_context_get_property 
(context=0x5601349a9150, property=0x560133f65582 "background-color", 
state=GTK_STATE_FLAG_NORMAL, value=0x7ffd77561c00) at 
../../../../gtk/gtkstylecontext.c:840
#8  0x7fe32c991945 in gtk_style_context_get_valist 
(context=context@entry=0x5601349a9150, state=state@entry=GTK_STATE_FLAG_NORMAL, 
args=args@entry=0x7ffd77561cb0) at ../../../../gtk/gtkstylecontext.c:876
#9  0x7fe32c991c3a in gtk_style_context_get (context=0x5601349a9150, 
state=state@entry=GTK_STATE_FLAG_NORMAL) at 
../../../../gtk/gtkstylecontext.c:918
#10 0x560133f63ca3 in wrapper_plug_draw (widget=0x560134bd2470, 
cr=0x560134b9dc00) at wrapper-plug.c:221
#11 0x7fe32ca3c144 in gtk_widget_draw_internal 
(widget=widget@entry=0x560134bd2470, cr=cr@entry=0x560134b9dc00, 
clip_to_size=clip_to_size@entry=1) at ../../../../gtk/gtkwidget.c:7080
#12 0x7fe32ca45740 in gtk_widget_render 
(widget=widget@entry=0x560134bd2470, window=0x5601348f5900, region=) at ../../../../gtk/gtkwidget.c:17606
#13 0x7fe32c8e6798 in gtk_main_do_event (event=0x7ffd77561f50) at 
../../../../gtk/gtkmain.c:1843
#14 gtk_main_do_event (event=) at ../../../../gtk/gtkmain.c:1690
#15 0x7fe32c5d0775 in _gdk_event_emit (event=event@entry=0x7ffd77561f50) at 
../../../../gdk/gdkevents.c:73
#16 

Processed: experimental bugs too

2020-10-18 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

> found 972417 1.7.0-1
Bug #972417 [xfce4-power-manager] xfce4-power-manager: System left idle => 
'display power management' auto-locks session => no X session or lightdm greeter
Marked as found in versions xfce4-power-manager/1.7.0-1.
> thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
972417: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=972417
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Processed: found 1.6.6-1

2020-10-18 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

> found 972417 1.6.6-1
Bug #972417 [xfce4-power-manager] xfce4-power-manager: System left idle => 
'display power management' auto-locks session => no X session or lightdm greeter
Marked as found in versions xfce4-power-manager/1.6.6-1.
> thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
972417: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=972417
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#972417: xfce4-power-manager: System left idle => 'display power management' auto-locks session => no X session or lightdm greeter

2020-10-18 Thread franck
Package: xfce4-power-manager
Version: 1.6.1-1
Severity: grave

Dear Maintainer,

[ Bug description ]
Bug happens when the screen auto-locks due to user inactivity. Then the screen 
switches off.
To easily test that, set following to 1 min or so
Xfce menu Applications -> Settings -> Power Manager -> Display -> 'Switch off 
after'

After such auto-lock, it appears not possible to get back the X session anymore.
Because
- by moving mouse or typing on keyboard the screen does not wake up. It stays 
off, black.
- with Ctrl+Alt-F7 one gets
This session is locked
You’ll be redirected to the unlock
dialog automatically in a few seconds
  but after waiting a few seconds the screen switches off again.
=> no way to get to the lightdm greeter.
In both cases: not possible to get back the running X session anymore.


[ Guilty package ]
Bug is _not_ triggered when user locks computer by doing any of
  Ctrl-Alt-Del
  xflock4  (in fact = Ctrl-Alt-Del)
  light-locker-command --lock
  dm-tool lock
As moving the mouse or typing on keyboard wakes up the screen and display the 
lightdm greeter.

=> I filled this bug against xfce4-power-manager
But I have no clue whether xfce4-power-manager
- processes the locking completely by itself ?
- just prepares locking, like deactivating keyboard/mouse? and then trigger 
like light-locker-command --lock...
- only asks another package to do the full locking procedure.


[ Workaround if locked out ]
Following allows to get the running X session back:
switch to tty1 by Ctrl+Alt+F1
  funny note: sometimes the mouse pointer is displayed on top of tty1 (moving 
the mouse does not move pointer).
log as root
run
  loginctl unlock-sessions
switch back to X by Alt+F7


[ Related packages version ]
All below are up to date Buster packages
dpkg -l "xfce4-power-manager" "lightdm*" "light-locker" "xfce4-session"
||/ NameVersion
ii  light-locker1.8.0-3
ii  lightdm 1.26.0-4
un  lightdm-greeter 
ii  lightdm-gtk-greeter 2.0.6-1
ii  xfce4-power-manager 1.6.1-1
ii  xfce4-session   4.12.1-6

Bug occurred under (at least) both kernels:
linux-image-4.19.0-11-amd64-unsigned 4.19.146-1
linux-image-5.8.0-0.bpo.2-amd64  5.8.10-1~bpo10+1

I tried Bullseye/Sid version: 1.6.6-1 by backporting it
Bug still occurs.
dpkg -l "xfce4-power-manager*" "lightdm*" "light-locker*" "xfce4-session*" 
"libxfce4ui*"
||/ NameVersion
ii  libxfce4ui-1-0:amd644.12.1-3 
ii  libxfce4ui-1-dev:amd64  4.12.1-3 
ii  libxfce4ui-2-0:amd644.14.1-1~bpo10+1 
ii  libxfce4ui-2-dev:amd64  4.14.1-1~bpo10+1 
ii  libxfce4ui-build-deps   4.14.1-1~bpo10+1 
ii  libxfce4ui-common   4.12.1-3 
ii  libxfce4ui-utils4.12.1-3 
ii  light-locker1.8.0-3  
ii  lightdm 1.26.0-4 
un  lightdm-greeter
ii  lightdm-gtk-greeter 2.0.6-1  
ii  xfce4-power-manager 1.6.6-1~bpo10+1  
ii  xfce4-power-manager-data1.6.6-1~bpo10+1  
ii  xfce4-power-manager-plugins 1.6.6-1~bpo10+1  
ii  xfce4-session   4.12.1-6 


[ Severity justification ]
As described in several reports, users usually handle the black screen by
  restarting the system 
or if users has root access:
  killall Xorg=> restarts X session
  killall lightdm => restarts X session
  killall light-locker=> X sessions won't lock anymore
All except last cause loss of unsaved data, last causes a security concern.
=> severity = grave

Also this bug gives a bad image to the user:
- 'system crashed'
- wondering what is the cause:
- is my graphic card not properly waking up ?
- or a bug in kernel ?
- or Xorg ?
- or light-locker ?
...
Thus they are probably numerous of open bugs that could be closed by fixing 
this bug.


[ Bugs reported against other packages, & that seem linked to this bug ]
Bugs in source package light-locker
  #906902 System left idle makes system freeze
  #870641 light-locker, lightdm: screen stays off after resume
  and all the merged one:
  805711, 846278, 868087, 908329, 922095, 929461, 929834, 931555
  #835461 light-locker breaks suspend/resume with nvidia legacy 340 drivers
Bugs in source package lightdm
  #867620 lightdm unlock screen randomly doesn't appear

Kind regards,
Franck Richter

-- System Information:
Debian Release: 10.6
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'proposed-updates'), (500, 
'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.8.0-0.bpo.2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages xfce4-power-manager depends on:
ii  libc6 2.28-10
ii  libcairo2 1.16.0-4
ii