Random Xorg freezes on Raspberry Pi 4 using Ubuntu 20.10
I already posted my problem here, but since Xorg seems to be the problem, posting it here too should be ok. Feel free to move this issue if this is not the right place.
I'm using Raspberry Pi 4B 8GB with Ubuntu 20.10 Desktop (ubuntu and lxqt) and after some hours (often during CPU/GPU-heavy work like using Firefox), the system freezes, which means:
- Screen freezes (just shows the same picture. mouse-cursor not moving, keyboard not working)
- Keyboard not responding (e.g. Num-LED not changing when pressing Num)
- Changing to another tty via e.g. Ctrl+Alt+F3 is not working anymore
- BUT: System in the background still works. I can still hear audio (of a movie for example). Other tasks like ffmpeg-downloads are still working.
During a freeze, Alt+SysRq+k isn't changing much. I can hear the audio stopping. But the system is "too frozen" to be able to kill Xorg. I also tried killing it via ssh - no chance. Alt+SysRq+reisub works to do a Pi-restart.
ps aux
via ssh tells me that these tasks have status D:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 4001 30.6 1.9 308852 154120 tty2 Dl+ 18:26 68:51 /usr/lib/xorg/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -nolisten tcp -background none -noreset -keeptty -novtswitch -verbose 7 -core root 151238 0.2 0.0 0 0 ? D 21:48 0:03 [kworker/0:3+events] root 151511 0.1 0.0 0 0 ? D 22:00 0:00 [kworker/3:0+events] root 151613 0.1 0.0 0 0 ? D 22:01 0:00 [kworker/1:2+events]
Starting gdb via ssh works, but as soon as I attach 4001 in this case, it is stuck and I can't do a backtrace. And since there is no crash (it's just a freeze), there is no file in /var/crash.
Spending lots of days, I (not an expert) couldn't narrow it down to a single program or task being the cause. My feeling is that it could be a series of causes and that mouse/keyboard are involved since Xorg.0.log is flooded with such messages:
[ 10768.574] (EE) event0 - Logitech USB Optical Mouse: client bug: event processing lagging behind by 17ms, your system is too slow [ 10848.910] (EE) event0 - Logitech USB Optical Mouse: client bug: event processing lagging behind by 23ms, your system is too slow [ 10853.079] (EE) event0 - Logitech USB Optical Mouse: client bug: event processing lagging behind by 15ms, your system is too slow [ 10861.285] (EE) event0 - Logitech USB Optical Mouse: client bug: event processing lagging behind by 11ms, your system is too slow [ 10863.204] (EE) event0 - Logitech USB Optical Mouse: client bug: event processing lagging behind by 11ms, your system is too slow [ 10863.384] (EE) event0 - Logitech USB Optical Mouse: client bug: event processing lagging behind by 15ms, your system is too slow [ 10863.384] (EE) event0 - Logitech USB Optical Mouse: WARNING: log rate limit exceeded (5 msgs per 60s). Discarding future messages. [ 10886.463] (EE) event1 - Logitech USB Keyboard: client bug: event processing lagging behind by 35ms, your system is too slow [ 10919.756] (EE) event1 - Logitech USB Keyboard: client bug: event processing lagging behind by 16ms, your system is too slow [ 10981.835] (EE) event0 - Logitech USB Optical Mouse: client bug: event processing lagging behind by 34ms, your system is too slow
Maybe someone has an idea when looking at the logs in the attachments. At the end of dmesg1.txt, a Xorg Calltrace is given. Here another dmesg_of_freeze_without_HDDs_connected.txt. Sometimes, status of Xorg is Sl+ after a freeze. Attaching the process in gdb gave this gdb-xorg-backtrace.txt. Hints about smarter debugging are also appreciated.
Btw, sudo X -version
:
X.Org X Server 1.20.9 X Protocol Version 11, Revision 0 Build Operating System: Linux 4.15.0-124-generic aarch64 Ubuntu Current Operating System: Linux myRaspi 5.8.0-1011-raspi #14-Ubuntu SMP PREEMPT Tue Dec 15 08:53:29 UTC 2020 aarch64 Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_headphones=1 video=HDMI-A-1:1680x1050M@60 smsc95xx.macaddr=XX:XX:XX:XX:XX:XX vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=tty1 root=LABEL=writable rootfstype=ext4 elevator=deadline rootwait fixrtc quiet splash Build Date: 30 November 2020 05:53:48PM xorg-server 2:1.20.9-2ubuntu1.1 (For technical support please see http://www.ubuntu.com/support) Current version of pixman: 0.38.4 Before reporting problems, check http://wiki.x.org to make sure that you have the latest version.