Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qt5_probing.py makes xorg.bin run with high CPU usage, eating RAM #1592

Open
noyannus opened this issue Dec 21, 2023 · 120 comments
Open

qt5_probing.py makes xorg.bin run with high CPU usage, eating RAM #1592

noyannus opened this issue Dec 21, 2023 · 120 comments
Assignees
Labels
Bug High Qt Qt bugs, code or features

Comments

@noyannus
Copy link

When backintime runs its qt5_probing.py, xorg.bin consumes a full CPU (~97..~102%). This happens only with the
/usr/bin/python3 /usr/share/backintime/common/qt5_probing.py processes. Quickly after they are killed, xorg.bin is back to normal.
Also RAM and swap fill up. If I don't kill the qt5_probing.py in time, the machine becomes unresponsive (and hot, duh).
Maybe related: their CPU loads are high themselves.

Before killing:

$ top -c
...
PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
2286 root      20   0 1569896 129604  88988 R 100,0 0,397  16:37.40 /usr/bin/Xorg.bin -nolisten tcp -background none -seat seat0 vt2 -auth /run/sddm/xauth_AwPWFy -noreset -displayfd 16
4336 root      39  19  190912  45644  30924 S 13,00 0,140   3:43.98 /usr/bin/python3 /usr/share/backintime/common/qt5_probing.py
4337 root      39  19  190912  45136  30672 S 13,00 0,138   3:44.16 /usr/bin/python3 /usr/share/backintime/common/qt5_probing.py
5468 root      39  19  190912  45260  30668 S 12,67 0,139   0:12.71 /usr/bin/python3 /usr/share/backintime/common/qt5_probing.py
5467 root      39  19  190912  45564  30844 S 12,00 0,140   0:12.43 /usr/bin/python3 /usr/share/backintime/common/qt5_probing.py
2857 me        20   0 4057896 477992 202676 S 6,667 1,464   1:20.04 /usr/bin/plasmashell --no-respawn
4334 root      39  19 1866060 1,764g   4096 S 5,333 5,667   1:20.48 python3 -Es /usr/share/backintime/common/backintime.py backup-job
4335 root      39  19 1866092 1,764g   4096 S 5,333 5,664   1:21.01 python3 -Es /usr/share/backintime/common/backintime.py --profile-id 2 backup-job
5464 root      39  19  129716 114832   4096 S 5,000 0,352   0:05.32 python3 -Es /usr/share/backintime/common/backintime.py backup-job
5466 root      39  19  129748 114576   4096 S 5,000 0,351   0:05.26 python3 -Es /usr/share/backintime/common/backintime.py --profile-id 2 backup-job
3095 me        20   0 1464276 126100  97488 S 0,667 0,386   0:03.97 /usr/bin/easyeffects --gapplication-service
  36 root      20   0       0      0      0 S 0,333 0,000   0:01.30 [ksoftirqd/3]
  48 root      20   0       0      0      0 S 0,333 0,000   0:01.15 [ksoftirqd/5]


The processes were killed with:

for pid in $(ps -ef | awk '/\/backintime\/common\/qt5_probing\.py/ {print $2}'); do kill -9 $pid; done

About a minute after after killing xorg.bin is at <1% CPU load.

$ top -c
...
PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
5759 root      39  19  158868 147672   4480 D 47,00 0,452   0:26.96 rsync
 2857 me        20   0 4066220 477992 202676 S 6,333 1,464   1:31.78 plasmashell
5813 root      20   0       0      0      0 I 3,667 0,000   0:00.74 kworker/u16:28-btrfs-endio-meta
5801 root      20   0       0      0      0 I 2,333 0,000   0:00.30 kworker/u16:15-btrfs-endio-meta
5835 root      20   0       0      0      0 I 2,000 0,000   0:00.42 kworker/u16:50-btrfs-endio-meta
5863 root      20   0       0      0      0 I 2,000 0,000   0:00.77 kworker/u16:78-btrfs-endio-meta
5822 root      20   0       0      0      0 I 1,333 0,000   0:00.42 kworker/u16:37-btrfs-endio-meta
2286 root      20   0 1572172 129732  88988 S 0,667 0,397  17:37.14 Xorg.bin
3064 me         9 -11  121496  21132   8832 S 0,667 0,065   0:01.50 pipewire
3095 me        20   0 1464276 129300  97488 S 0,667 0,396   0:05.39 easyeffects
  89 root       0 -20       0      0      0 I 0,333 0,000   0:00.11 kworker/0:1H-kblockd
 200 root       0 -20       0      0      0 I 0,333 0,000   0:00.15 kworker/1:1H-kblockd
 201 root       0 -20       0      0      0 I 0,333 0,000   0:00.07 kworker/4:1H-kblockd
 202 root       0 -20       0      0      0 I 0,333 0,000   0:00.18 kworker/7:1H-kblockd

The backup jobs have finished (one rsync is still active), but earlier tests have shown that they not the culprits.

This happened with BiT version 1.4.1 both from YaST (SUSE packet manager), and directly from GitHub.
Python version is 3.11.6.
Operating System: openSUSE Tumbleweed 20231215
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.112.0
Qt Version: 5.15.11
Kernel Version: 6.6.3-1-default (64-bit)
Graphics Platform: X11
Processors: 8 × 11th Gen Intel® Core™ i7-1165G7 @ 2.80GHz

To help us diagnose the problem quickly, please provide the output of the console command backintime --diagnostics.

Wellllll..... Could that have a common cause?

$ backintime --diagnostics
Traceback (most recent call last):
File "/usr/share/backintime/common/backintime.py", line 1190, in <module>
startApp()
File "/usr/share/backintime/common/backintime.py", line 507, in startApp
args = argParse(None)
^^^^^^^^^^^^^^
File "/usr/share/backintime/common/backintime.py", line 568, in argParse
args, unknownArgs = mainParser.parse_known_args(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/argparse.py", line 1902, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/argparse.py", line 2114, in _parse_known_args
start_index = consume_optional(start_index)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/argparse.py", line 2054, in consume_optional
take_action(action, args, option_string)
File "/usr/lib64/python3.11/argparse.py", line 1978, in take_action
action(self, namespace, argument_values, option_string)
File "/usr/share/backintime/common/backintime.py", line 742, in __call__
diagnostics = collect_diagnostics()
^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/backintime/common/diagnostics.py", line 74, in collect_diagnostics
'OS': _get_os_release()
^^^^^^^^^^^^^^^^^
File "/usr/share/backintime/common/diagnostics.py", line 398, in _get_os_release
return osrelease['os-release']
~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'os-release'
@buhtz
Copy link
Member

buhtz commented Dec 21, 2023

Thanks for reporting. Might be related to #1580 . Aryoda will reply soon.

The problem with --diagnostics is known and fixed upstream but not released yet. You can ignore it.

@buhtz buhtz added Qt Qt bugs, code or features Bug labels Dec 21, 2023
@aryoda aryoda added the High label Dec 21, 2023
@aryoda
Copy link
Contributor

aryoda commented Dec 21, 2023

@noyannus You are running BiT as root (at least the process owner is root)?
Then definitely related to #1580

I still did not manage to set up a Thumbleweed virtual machine with a working Gnome or KDE DE to debug this (working on it, requires manual installation).

@noyannus
Copy link
Author

@noyannus You are running BiT as root (at least the process owner is root)?

Yes.

I still did not manage to set up a Thumbleweed virtual machine with a working Gnome or KDE DE to debug this (working on it, requires manual installation).

Installer comes as full DVD and as netinstall that downloads as needed. If you only used one of these options, maybe the other works better? (No idea, just speculating).

@aryoda aryoda self-assigned this Dec 21, 2023
@aryoda
Copy link
Contributor

aryoda commented Dec 21, 2023

I have now set up a VirtualBox VM using these instructions and it went surprisingly smooth:

https://techviewleo.com/install-opensuse-tumbleweed-on-virtualbox-vmware-workstation/

@noyannus

I have installed a fresh Tumbleweed 20231219 with

  • KDE Plasma 5.27.10 (same as yours)
  • KDE Frameworks Version 5.113.0 (yours is 5.112.0)
  • Qt Version 5.15.11 (same as yours)
  • Kernel Version 6.6.6-1-default (64-bit) (yours was 6.6.3-1-default)
  • Graphics Platform: X11 (same as yours)
  • Python3 version 3.11.6 (same as yours)

and installed BiT v1.4.1 via yast but could not reproduce the problem (with BiT root): When starting a backup via the BiT Qt GUI

  • the systray icon appears
  • the backups finishes
  • and the systray icon disappears again
  • My CPU load is also normal

qt5_probing.py is used to check if a systray icon can be shown.

Could you please provide me more details how to reproduce the problem, eg.

  • which GPU is installed (may be a Qt5 issue)
  • how do you start the backup (GUI, CLI or scheduled via cron)
  • does it always happen
  • could provide me here an anonymized minimal profile config file that reproduces the problem on your machine
  • which user rights and owner are set on the backup target folder and the included folders/files?

@ptilopteri
Copy link

the "problem" is not when starting from GUI as that works fine.
the problem is when starting from a cron job generated by BiT.

@ptilopteri
Copy link

As ROOT

@aryoda
Copy link
Contributor

aryoda commented Dec 21, 2023

I am running a cron job as root (created by BiT) without errors now for 30 minutes (executed every 5 minutes).

Any more ideas what could be different in your setup?

BTW: A temporary workaround would be to deactivate the BiT systray icon be "deleting" the systrayiconplugin.py from the plugin folder:

bit@localhost:/usr/share/backintime/plugins> sudo mv systrayiconplugin.py ..

@ptilopteri
Copy link

no idea, but will test your sidestep and report. tks

@ptilopteri
Copy link

that worked "this time" for me.
removed systrayiconplugin.py

seems there exists no option to control this "plugin" ??
** perhaps a permissions problem ? **

tks, will monitor and report any further failures. tks

@aryoda
Copy link
Contributor

aryoda commented Dec 22, 2023

seems there exists no option to control this "plugin" ??

Unfortunately not, this is legacy work and the idea was to separately package plugins to install/uninstall them but every package I know delivers the systray icon plugin always together with the BiT (Qt5) GUI.

** perhaps a permissions problem ? **

Most probably in Qt5 or the Qt5 wrapper in combination with the cron which provides only a reduced environment and perhaps something is missing (but why only on your computer and not in my VM?). We have an open issue with a segfault which may be related (but almost impossible to diagnose: #1095) and this could happen when qt5_probing.py segfaults too and tries to write a core dump which the parent process tries to prevent...

@aryoda
Copy link
Contributor

aryoda commented Dec 22, 2023

Could you please post the output of

pkexec env DISPLAY=$DISPLAY XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR XAUTHORITY=$XAUTHORITY python3 -c "from PyQt5.QtGui import QIcon; from PyQt5.QtWidgets import QSystemTrayIcon,QApplication; app = QApplication(['']); print('isSystemTrayAvailable: ' + str(QSystemTrayIcon.isSystemTrayAvailable())); print('Theme name: ' + QIcon.themeName()); print('has theme icon <document-save>: ' + str(QIcon.hasThemeIcon('document-save'))); print('themeSearchPaths: ' + str(QIcon.themeSearchPaths())); print('fallbackSearchPaths: ' + str(QIcon.fallbackSearchPaths())); print('fallbackThemeName: ' + str(QIcon.fallbackThemeName()))"

here. I want to check if a non-standard Qt5/KDE theme could cause the trouble for root with cron...

On my VM I get this output:

QStandardPaths: runtime directory '/run/user/1000' is not owned by UID 0, but a directory permissions 0700 owned by UID 1000 GID 1000
isSystemTrayAvailable: True
Theme name: hicolor
has theme icon <document-save>: False
themeSearchPaths: ['/usr/share/icons', ':/icons']
fallbackSearchPaths: ['/usr/share/pixmaps']
fallbackThemeName: hicolor

@ptilopteri
Copy link

I only have this problem with root from cron, never from the qt app as root or any occasion as . And do not have it on my server with:
backintime-qt4-1.1.20-3.6.1.noarch
backintime-1.1.20-3.6.1.noarch

@ptilopteri
Copy link

ptilopteri commented Dec 22, 2023

# pkexec env DISPLAY=$DISPLAY XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR XAUTHORITY=$XAUTHORITY python3 -c "from PyQt5.QtGui import QIcon; from PyQt5.QtWidgets import QSystemTrayIcon,QApplication; app = QApplication(['']); print('isSystemTrayAvailable: ' + str(QSystemTrayIcon.isSystemTrayAvailable())); print('Theme name: ' + QIcon.themeName()); print('has theme icon <document-save>: ' + str(QIcon.hasThemeIcon('document-save'))); print('themeSearchPaths: ' + str(QIcon.themeSearchPaths())); print('fallbackSearchPaths: ' + str(QIcon.fallbackSearchPaths())); print('fallbackThemeName: ' + str(QIcon.fallbackThemeName()))"
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

@noyannus
Copy link
Author

@aryoda

Could you please provide me more details how to reproduce the problem, eg.

which GPU is installed (may be a Qt5 issue)

The GPU and other graphics info:

# lshw -c display -sanitize
*-display
description: VGA compatible controller
product: TigerLake-LP GT2 [Iris Xe Graphics]
vendor: Intel Corporation
physical id: 2
bus info: pci@0000:00:02.0
logical name: /dev/fb0
version: 01
width: 64 bits
clock: 33MHz
capabilities: pciexpress msi pm vga_controller bus_master cap_list rom fb
configuration: depth=32 driver=i915 latency=0 mode=1920x1080 resolution=2256,1504 visual=truecolor xres=1920 yres=1080
resources: iomemory:600-5ff iomemory:400-3ff irq:145 memory:605c000000-605cffffff memory:4000000000-400fffffff ioport:3000(size=64) memory:c0000-dffff memory:4010000000-4016ffffff memory:4020000000-40ffffffff

how do you start the backup (GUI, CLI or scheduled via cron)

BiT is started for two backups, via anacron every 1 and 4 hours, set in the GUI.

does it always happen

Returns after every boot.

could provide me here an anonymized minimal profile config file that reproduces the problem on your machine

I have appended it below for better readability.

which user rights and owner are set on the backup target folder and the included folders/files?

# find /media/backups/ -maxdepth 5 -ls
  220608      0 drwxrwxrwx   1 root     root           32 Nov 30 16:05 /media/backups/
     256     16 drwxrwxrwx   1 me       me             20 Dez 12 11:30 /media/backups/backup-1
     257      0 drwxrwxrwx   1 root     root           10 Dez 12 11:30 /media/backups/backup-1/backintime
     258      0 drwxrwxrwx   1 root     root            8 Dez 12 11:30 /media/backups/backup-1/backintime/[redacted]
     259      0 drwxr-xr-x   1 root     root            2 Dez 12 11:30 /media/backups/backup-1/backintime/[redacted]/root
     260      0 drwxr-xr-x   1 root     root          254 Dez 22 09:42 /media/backups/backup-1/backintime/[redacted]/root/1
     256     16 drwxrwx---   1 me       me             20 Dez 12 02:14 /media/backups/backup-2
53607347      0 drwxrwxrwx   1 root     root           10 Dez 12 02:14 /media/backups/backup-2/backintime
53607348      0 drwxrwxrwx   1 root     root            8 Dez 12 02:14 /media/backups/backup-2/backintime/[redacted]
53607349      0 drwxr-xr-x   1 root     root            2 Dez 13 02:05 /media/backups/backup-2/backintime/[redacted]/root
53607350      0 drwxr-xr-x   1 root     root          292 Dez 22 09:35 /media/backups/backup-2/backintime/[redacted]/root/2

May also be of interest:

# pkexec env DISPLAY=$DISPLAY XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR XAUTHORITY=$XAUTHORITY ... returns

QStandardPaths: runtime directory '/run/user/1000' is not owned by UID 0, but a directory permissions 0700 owned by UID 1000 GID 1000
isSystemTrayAvailable: True
Theme name: hicolor
has theme icon <document-save>: False
themeSearchPaths: ['/usr/local/share/icons', '/usr/share/icons', ':/icons']
fallbackSearchPaths: ['/usr/share/pixmaps']
fallbackThemeName: hicolor

The only config is /root/.config/backintime/config (no configs in ~/.config/backintime/ or /etc/backintime/)

config.version=6
global.use_flock=false
internal.manual_starts_countdown=-1
profile1.qt.last_path=/
profile1.qt.places.SortColumn=1
profile1.qt.places.SortOrder=0
profile1.qt.settingsdialog.exclude.SortColumn=1
profile1.qt.settingsdialog.exclude.SortOrder=0
profile1.qt.settingsdialog.include.SortColumn=1
profile1.qt.settingsdialog.include.SortOrder=0
profile1.schedule.custom_time=8,12,18,23
profile1.schedule.day=1
profile1.schedule.mode=25
profile1.schedule.repeatedly.period=1
profile1.schedule.repeatedly.unit=10
profile1.schedule.time=0
profile1.schedule.weekday=7
profile1.snapshots.backup_on_restore.enabled=true
profile1.snapshots.bwlimit.enabled=false
profile1.snapshots.bwlimit.value=3000
profile1.snapshots.continue_on_errors=true
profile1.snapshots.copy_links=false
profile1.snapshots.copy_unsafe_links=false
profile1.snapshots.cron.ionice=true
profile1.snapshots.cron.nice=true
profile1.snapshots.cron.redirect_stderr=false
profile1.snapshots.cron.redirect_stdout=true
profile1.snapshots.dont_remove_named_snapshots=true
profile1.snapshots.exclude.1.value=.gvfs
profile1.snapshots.exclude.2.value=.cache/*
profile1.snapshots.exclude.3.value=.thumbnails*
profile1.snapshots.exclude.4.value=.local/share/[Tt]rash*
profile1.snapshots.exclude.5.value=*.backup*
profile1.snapshots.exclude.6.value=*~
profile1.snapshots.exclude.7.value=.dropbox*
profile1.snapshots.exclude.8.value=/proc/*
profile1.snapshots.exclude.9.value=/sys/*
profile1.snapshots.exclude.10.value=/dev/*
profile1.snapshots.exclude.11.value=/run/*
profile1.snapshots.exclude.12.value=/etc/mtab
profile1.snapshots.exclude.13.value=/var/cache/apt/archives/*.deb
profile1.snapshots.exclude.14.value=lost+found/*
profile1.snapshots.exclude.15.value=/tmp/*
profile1.snapshots.exclude.16.value=/var/tmp/*
profile1.snapshots.exclude.17.value=/var/backups/*
profile1.snapshots.exclude.18.value=.Private
profile1.snapshots.exclude.19.value=/home/[redacted]
profile1.snapshots.exclude.20.value=/home/[redacted]
profile1.snapshots.exclude.21.value=* ~
profile1.snapshots.exclude.22.value=* BUP
profile1.snapshots.exclude.23.value=/home/[redacted]
profile1.snapshots.exclude.24.value=/.snapshots
profile1.snapshots.exclude.25.value=/timeshift
profile1.snapshots.exclude.26.value=/*.Trash-0/*
profile1.snapshots.exclude.27.value=/media/*/*
profile1.snapshots.exclude.bysize.enabled=false
profile1.snapshots.exclude.bysize.value=500
profile1.snapshots.exclude.size=27
profile1.snapshots.include.1.type=0
profile1.snapshots.include.1.value=/
profile1.snapshots.include.2.type=0
profile1.snapshots.include.2.value=/home/[redacted]
profile1.snapshots.include.3.type=0
profile1.snapshots.include.3.value=/home/[redacted]
profile1.snapshots.include.4.type=0
profile1.snapshots.include.4.value=/home/[redacted]
profile1.snapshots.include.5.type=0
profile1.snapshots.include.5.value=/home/[redacted]
profile1.snapshots.include.6.type=0
profile1.snapshots.include.6.value=/etc
profile1.snapshots.include.size=6
profile1.snapshots.local.nocache=false
profile1.snapshots.local.password.save=false
profile1.snapshots.local.password.use_cache=true
profile1.snapshots.local_encfs.path=/media/backups/backup-1
profile1.snapshots.log_level=3
profile1.snapshots.min_free_inodes.enabled=true
profile1.snapshots.min_free_inodes.value=5
profile1.snapshots.min_free_space.enabled=true
profile1.snapshots.min_free_space.unit=20
profile1.snapshots.min_free_space.value=100
profile1.snapshots.mode=local
profile1.snapshots.no_on_battery=true
profile1.snapshots.notify.enabled=false
profile1.snapshots.path=/media/backups/backup-1
profile1.snapshots.path.host=frawo
profile1.snapshots.path.profile=1
profile1.snapshots.path.user=root
profile1.snapshots.preserve_acl=true
profile1.snapshots.preserve_xattr=true
profile1.snapshots.remove_old_snapshots.enabled=true
profile1.snapshots.remove_old_snapshots.unit=80
profile1.snapshots.remove_old_snapshots.value=1
profile1.snapshots.rsync_options.enabled=false
profile1.snapshots.rsync_options.value=
profile1.snapshots.smart_remove=true
profile1.snapshots.smart_remove.keep_all=1
profile1.snapshots.smart_remove.keep_one_per_day=7
profile1.snapshots.smart_remove.keep_one_per_month=24
profile1.snapshots.smart_remove.keep_one_per_week=8
profile1.snapshots.smart_remove.run_remote_in_background=false
profile1.snapshots.ssh.check_commands=true
profile1.snapshots.ssh.check_ping=true
profile1.snapshots.ssh.cipher=default
profile1.snapshots.ssh.host=
profile1.snapshots.ssh.ionice=false
profile1.snapshots.ssh.nice=false
profile1.snapshots.ssh.nocache=false
profile1.snapshots.ssh.path=
profile1.snapshots.ssh.port=22
profile1.snapshots.ssh.prefix.enabled=false
profile1.snapshots.ssh.prefix.value=PATH=/opt/bin:/opt/sbin:\$PATH
profile1.snapshots.ssh.private_key_file=
profile1.snapshots.ssh.user=root
profile1.snapshots.take_snapshot_regardless_of_changes=true
profile1.snapshots.use_checksum=false
profile1.snapshots.user_backup.ionice=true
profile2.name=backup2 (4 h)
profile2.qt.last_path=/home/[redacted]
profile2.qt.places.SortColumn=1
profile2.qt.places.SortOrder=0
profile2.qt.settingsdialog.exclude.SortColumn=1
profile2.qt.settingsdialog.exclude.SortOrder=0
profile2.qt.settingsdialog.include.SortColumn=1
profile2.qt.settingsdialog.include.SortOrder=0
profile2.schedule.custom_time=8,12,18,23
profile2.schedule.day=1
profile2.schedule.mode=25
profile2.schedule.repeatedly.period=4
profile2.schedule.repeatedly.unit=10
profile2.schedule.time=0
profile2.schedule.weekday=7
profile2.snapshots.backup_on_restore.enabled=true
profile2.snapshots.bwlimit.enabled=false
profile2.snapshots.bwlimit.value=3000
profile2.snapshots.continue_on_errors=true
profile2.snapshots.copy_links=false
profile2.snapshots.copy_unsafe_links=false
profile2.snapshots.cron.ionice=true
profile2.snapshots.cron.nice=true
profile2.snapshots.cron.redirect_stderr=false
profile2.snapshots.cron.redirect_stdout=true
profile2.snapshots.dont_remove_named_snapshots=true
profile2.snapshots.exclude.1.value=.gvfs
profile2.snapshots.exclude.2.value=.cache/*
profile2.snapshots.exclude.3.value=.thumbnails*
profile2.snapshots.exclude.4.value=.local/share/[Tt]rash*
profile2.snapshots.exclude.5.value=*.backup*
profile2.snapshots.exclude.6.value=*~
profile2.snapshots.exclude.7.value=.dropbox*
profile2.snapshots.exclude.8.value=/proc/*
profile2.snapshots.exclude.9.value=/sys/*
profile2.snapshots.exclude.10.value=/dev/*
profile2.snapshots.exclude.11.value=/run/*
profile2.snapshots.exclude.12.value=/etc/mtab
profile2.snapshots.exclude.13.value=/var/cache/apt/archives/*.deb
profile2.snapshots.exclude.14.value=lost+found/*
profile2.snapshots.exclude.15.value=/tmp/*
profile2.snapshots.exclude.16.value=/var/tmp/*
profile2.snapshots.exclude.17.value=/var/backups/*
profile2.snapshots.exclude.18.value=.Private
profile2.snapshots.exclude.19.value=/home/[redacted]
profile2.snapshots.exclude.20.value=/home/[redacted]
profile2.snapshots.exclude.21.value=* ~
profile2.snapshots.exclude.22.value=* BUP
profile2.snapshots.exclude.23.value=/home/[redacted]
profile2.snapshots.exclude.24.value=/.snapshots
profile2.snapshots.exclude.25.value=/timeshift
profile2.snapshots.exclude.26.value=/*.Trash-0/*
profile2.snapshots.exclude.27.value=/media/*/*
profile2.snapshots.exclude.bysize.enabled=false
profile2.snapshots.exclude.bysize.value=500
profile2.snapshots.exclude.size=27
profile2.snapshots.include.1.type=0
profile2.snapshots.include.1.value=/
profile2.snapshots.include.2.type=0
profile2.snapshots.include.2.value=/home/[redacted]
profile2.snapshots.include.3.type=0
profile2.snapshots.include.3.value=/home/[redacted]
profile2.snapshots.include.4.type=0
profile2.snapshots.include.4.value=/home/[redacted]
profile2.snapshots.include.5.type=0
profile2.snapshots.include.5.value=/home/[redacted]
profile2.snapshots.include.6.type=0
profile2.snapshots.include.6.value=/etc
profile2.snapshots.include.size=6
profile2.snapshots.local.nocache=false
profile2.snapshots.local.password.save=false
profile2.snapshots.local.password.use_cache=true
profile2.snapshots.local_encfs.path=/media/backups/backup-2
profile2.snapshots.log_level=3
profile2.snapshots.min_free_inodes.enabled=true
profile2.snapshots.min_free_inodes.value=5
profile2.snapshots.min_free_space.enabled=true
profile2.snapshots.min_free_space.unit=20
profile2.snapshots.min_free_space.value=100
profile2.snapshots.mode=local
profile2.snapshots.no_on_battery=true
profile2.snapshots.notify.enabled=false
profile2.snapshots.path=/media/backups/backup-2
profile2.snapshots.path.host=frawo
profile2.snapshots.path.profile=2
profile2.snapshots.path.user=root
profile2.snapshots.preserve_acl=true
profile2.snapshots.preserve_xattr=true
profile2.snapshots.remove_old_snapshots.enabled=true
profile2.snapshots.remove_old_snapshots.unit=80
profile2.snapshots.remove_old_snapshots.value=1
profile2.snapshots.rsync_options.enabled=false
profile2.snapshots.rsync_options.value=
profile2.snapshots.smart_remove=true
profile2.snapshots.smart_remove.keep_all=1
profile2.snapshots.smart_remove.keep_one_per_day=7
profile2.snapshots.smart_remove.keep_one_per_month=24
profile2.snapshots.smart_remove.keep_one_per_week=8
profile2.snapshots.smart_remove.run_remote_in_background=false
profile2.snapshots.ssh.check_commands=true
profile2.snapshots.ssh.check_ping=true
profile2.snapshots.ssh.cipher=default
profile2.snapshots.ssh.host=
profile2.snapshots.ssh.ionice=false
profile2.snapshots.ssh.nice=false
profile2.snapshots.ssh.nocache=false
profile2.snapshots.ssh.path=
profile2.snapshots.ssh.port=22
profile2.snapshots.ssh.prefix.enabled=false
profile2.snapshots.ssh.prefix.value=PATH=/opt/bin:/opt/sbin:\$PATH
profile2.snapshots.ssh.private_key_file=
profile2.snapshots.ssh.user=root
profile2.snapshots.take_snapshot_regardless_of_changes=true
profile2.snapshots.use_checksum=false
profile2.snapshots.user_backup.ionice=true
profiles=1:2
profiles.version=1
qt.last_path=/
qt.logview.height=690
qt.logview.width=1444
qt.main_window.files_view.date_width=100
qt.main_window.files_view.name_width=100
qt.main_window.files_view.size_width=100
qt.main_window.files_view.sort.ascending=true
qt.main_window.files_view.sort.column=0
qt.main_window.height=1012
qt.main_window.main_splitter_left_w=211
qt.main_window.main_splitter_right_w=632
qt.main_window.second_splitter_left_w=230
qt.main_window.second_splitter_right_w=383
qt.main_window.width=847
qt.main_window.x=1698
qt.main_window.y=0
qt.show_hidden_files=false

@aryoda
Copy link
Contributor

aryoda commented Dec 22, 2023

does it always happen

Returns after every boot.

Ah! Does the anchron BiT job hang if it is started after a reboot but before the first user is logged in with a desktiop environment like KDE Plasma (establishing an Xorg session)? Anachron does directly start overdue jobs...

This could also explain why the old implementation of checking for systray icon support using xdpinfo failed (hung) as reported in #1580...

I am trying to test scenario this in my VM...

Notes:

  • In BIT hangs when starting a backup as root #1580 the user reported the same problem for Wayland so it is not only related to X11
  • Since Qt5's internal implementation of checking if a systray icon is allowed uses a (user) DBus call and without a started desktop environment no (user) DBus exists this may be blocking or retrying forever...

@ptilopteri
Copy link

note that xdpyinfo does not appear to be present when my instance hangs.

@ptilopteri
Copy link

do not know what has changed but my root instance started by cron is again hanging:

(lines will wrap):
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 30470 11.5 35.6 13240528 13184432 ? RN 07:00 19:48 python3 -Es /usr/share/backintime/common/backintime.py --profile-id 2 backup-job
root 30471 35.2 0.1 190992 45364 ? SNl 07:00 60:22 _ /usr/bin/python3 /usr/share/backintime/common/qt5_probing.py

@ptilopteri
Copy link

note, maybe because I renamed rather than deleting the systrayplugin. have now deleted them.

@aryoda
Copy link
Contributor

aryoda commented Dec 22, 2023

do not know what has changed but my root instance started by cron is again hanging:
note, maybe because I renamed rather than deleting the systrayplugin. have now deleted them.

renaming does not work, only moving into another folder or deleting it (since all *.py files in the plugin folder will be loaded in BiT)

@aryoda
Copy link
Contributor

aryoda commented Dec 22, 2023

I could reproduce it by booting without logging in while a BiT root cron job starts every 5 minutes (no need to use anacron.

100 % cpu and a few dozens of hanging processes:

bit@localhost:~> ps ax | grep -i backintime
 1345 ?        SN     2:31 python3 -Es /usr/share/backintime/common/backintime.py --profile-id 2 backup-job
 1347 ?        S      0:00 /usr/bin/python3 -Es /usr/share/backintime/qt/serviceHelper.py
 1352 ?        RNl    6:13 /usr/bin/python3 /usr/share/backintime/common/qt5_probing.py
 1401 ?        RN     1:59 python3 -Es /usr/share/backintime/common/backintime.py --profile-id 2 backup-job
 1402 ?        SNl    4:42 /usr/bin/python3 /usr/share/backintime/common/qt5_probing.py
...

THX a lot for your very helpful kill script in your first post ;-)

Now I have to find a way to debug this without having a debugging GUI in my VM and simulating a started cron job...

@noyannus
Copy link
Author

@aryoda

I could reproduce it by booting without logging in while a BiT root cron job starts every 5 minutes (no need to use anacron.

100 % cpu and a few dozens of hanging processes:

Strange. I rebooted to CLI, logged in as root and waited for ~15min. The only python processes were a backup-job after ~2min and later another. Seems legit; I have two backup profiles active.

If you want me to provide additional info or do some tests, tell me soon. I plan to change to a LVM setup during the holidays and that may entail a fresh system setup (have not researched the procedure yet).

THX a lot for your very helpful kill script in your first post ;-)

Save it somewhere; the structure is great for anything that needs checking at regular intervals. With a sound alarm (alsabat) I use it to get noticed when my Internet is alive again (ping instead of ps of course).

@noyannus
Copy link
Author

noyannus commented Dec 22, 2023

I've made it into a login script:
edit: corrected an error.

#!/usr/bin/bash

# kills backintime probing processes
# /usr/share/backintime/common/backintime.py


wait=5   # wait minutes

while true; do # start loop again after killing processes and waiting time

    for pid in $(ps -ef | awk '/\/backintime\/common\/qt5_probing\.py/ {print $2}'); do
        kill -9 $pid;
    done

    sleep $(($wait * 60))

done

# for pid in $(ps -ef | awk '/\/backintime\/common\/qt5_probing\.py/ {print $2}'); do kill -9 $pid; done

@aryoda
Copy link
Contributor

aryoda commented Dec 22, 2023

I rebooted to CLI, logged in as root and waited for ~15min. The only python processes were a backup-job after ~2min and later another. Seems legit; I have two backup profiles active.

I can even provoke the problem by switching to a terminal in the login screen after booting (via Ctrl+Alt+F1 or Host-Key+F1 in my VM) and manually starting a backup with backintime --profile-id 1 backup-job.
Then I can see the hanging qt5_probing.py process with ps ax | grep -i backintime...

If you want me to provide additional info or do some tests, tell me soon.
I plan to change to a LVM setup during the holidays and that may entail a fresh system setup

I can reproduce the problem now and once I fix it it would be great if could test it again
(just depends on who is faster - me with a fix or you with a new system installation.
But no pressure from my side, holidays are the perfect time to do such maintenance work).

@noyannus
Copy link
Author

noyannus commented Dec 22, 2023

I can reproduce the problem now and once I fix it it would be great if could test it again
(just depends on who is faster - me with a fix or you with a new system installation.
But no pressure from my side, holidays are the perfect time to do such maintenance work).

OK. See on the other side. :-)

Oh-- and have great holidays!

@ptilopteri
Copy link

ptilopteri commented Feb 1, 2024 via email

@aryoda
Copy link
Contributor

aryoda commented Feb 1, 2024

@ptilopteri My bad, I forgot to remove other code changes before testing the proposed workaround. Thanks a lot for reporting it here.

I will prepare a patch file to disable the qt5 probing as root (even though the GUI will also be affected) but for now this will be the easiest workaround for you until I find a better solution.

@aryoda
Copy link
Contributor

aryoda commented Feb 2, 2024

@ptilopteri I have prepared a workaround as patch for the hanging qt5_probing.py which works in my VM:

1592_workaround.txt

To apply it use

sudo patch -p1 /usr/share/backintime/common/qt5_probing.py < 1592_workaround.txt

with the correct installation path of backintime (which backintime).

This effectively disables qt5_probing completely if run as root so you should never see a hanging qt5_probing.py (can be checked with ps which shows the path).

@ptilopteri
Copy link

ptilopteri commented Feb 2, 2024 via email

@aryoda
Copy link
Contributor

aryoda commented Feb 2, 2024

that works for me but now there is no systemtrayicon.

THX a lot for testing and reporting the test results here!

That is intentional since it is a workaround (better no systray icon instead of a hanging system)
until I find a better solution.

and with removing /usr/share/backintime/plugins/qt4plugin.py

This file should not be installed anymore since BiT v1.4.0
If it still existed it would explain why the system did hang no matter what changes were made to qt5_probing.py.

Since BiT v1.4.3 (release yesterday) make install does remove qt4plugin.py to avoid such left-over files.

@ptilopteri
Copy link

ptilopteri commented Feb 6, 2024 via email

@aryoda
Copy link
Contributor

aryoda commented Feb 8, 2024

latest BiT build, c65fc91, is again hanging on /usr/share/backintime/common/qt5_probing.py and will not progress until /killing that process. root cron job.

Did you apply my patch after installing this build?

Without that patch your system will hang for whatever reasons.

As I mentioned here I am trying to find a solution that will show at least the systray icon for BiT (root) backups started via the GUI (but not by cron as root - this is simply not reliable anymore).

Please give me some time for this...

@ptilopteri
Copy link

ptilopteri commented Feb 8, 2024 via email

@ptilopteri
Copy link

ptilopteri commented Feb 20, 2024 via email

@aryoda
Copy link
Contributor

aryoda commented Feb 20, 2024

/usr/share/backintime/common/qt5_probing.py is stil present
Isn't that supposed to be removed?

No, it requires "just" a decent fix (subject to be found). All I can do now is ask for patience...

@ptilopteri
Copy link

ptilopteri commented Feb 24, 2024 via email

@aryoda
Copy link
Contributor

aryoda commented Feb 24, 2024

built 1.4.4-dev.5cbffdf5 today and your patch no longer takes. Is it not anymore required?

What do you mean with "no longer takes"?

Does patching fail or is the patch no longer required to avoid the high CPU usage?

Some background: A few commits ago we migrated the dev version of BiT from Qt5 to Qt6 (using the Python package PyQt6) which also required renaming the qt5_probing.py to qt_probing.py (so my above patch may not find the file anymore) but Qt6 may possibly also contain a fix for the problem.

@ptilopteri
Copy link

ptilopteri commented Feb 24, 2024 via email

@ptilopteri
Copy link

ptilopteri commented Feb 25, 2024 via email

@aryoda
Copy link
Contributor

aryoda commented May 3, 2024

TODO: Check if this kernel change may be reason the for the blocking xorg.bin:

Disallows open of FIFOs or regular files not owned by the user in world
writable sticky directories, unless the owner is the same as that of the
directory or the file is opened without the O_CREAT flag.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=30aba6656f61ed44cba445a3c0d38b296fa9e8f5

We are "hijacking" the X11 files of the user 1000 when running as root "just" to show the systray icon:

echo $XDG_RUNTIME_DIR
/run/user/1000
~ > echo $XAUTHORITY
/run/user/1000/gdm/Xauthority

It looks like the kernel patch may strike here...

@emtiu
Copy link
Member

emtiu commented Jul 17, 2024

We are "hijacking" the X11 files of the user 1000 when running as root "just" to show the systray icon:

echo $XDG_RUNTIME_DIR
/run/user/1000
~ > echo $XAUTHORITY
/run/user/1000/gdm/Xauthority

It looks like the kernel patch may strike here...

It looks like the same problem is at work in #1716.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug High Qt Qt bugs, code or features
Projects
None yet
Development

No branches or pull requests

5 participants