Bug 477320 - Very high CPU and memory consumption, no activity
Summary: Very high CPU and memory consumption, no activity
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Manjaro Linux
: NOR major
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-21 09:54 UTC by pierreballif.pb+kde
Modified: 2023-11-27 12:22 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
A Valgrind trace of the program execution. (624.56 KB, text/x-log)
2023-11-21 09:54 UTC, pierreballif.pb+kde
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pierreballif.pb+kde 2023-11-21 09:54:08 UTC
Created attachment 163338 [details]
A Valgrind trace of the program execution.

SUMMARY
Many KDE applications exhibit the following behavior. They do not display a window, nor write anything to the console, but they use 100% of one CPU and their memory consumption increases enormously (1 more GB every 5-10 seconds) until the OS runs out of RAM and freezes.

STEPS TO REPRODUCE
Run `dolphin` in a terminal, and `htop` in another terminal. (Other applications than dolphin have a similar behaviour).

OBSERVED RESULT
Nothing is displayed in the terminal and no window appears. The process `dolphin` is reported by `htop` to consume around 100% CPU and to increase its memory consumption by 1 GB every 5-10 seconds, until the process is interrupted or the system runs out of memory.

EXPECTED RESULT
The applications start a graphical window.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux 5.15.138-1-MANJARO #1 SMP PREEMPT
(available in About System)
KDE Plasma Version: plasmashell 5.27.9
KDE Frameworks Version: 5.112.0-1; dolphin 23.08.3
Qt Version: Qt 5.15.11

ADDITIONAL INFORMATION
I encountered this problem with the following applications: Kate, Dolphin, System settings, and starting a Plasma session (since Plasma doesn't work, I use the i3 WM for the other applications). Konsole and KDE Connect work fine; Okular also works fine as long as I don't open the "Open File" or "Print to File" menus. Sometimes, `/usr/lib/kactivitiesmanagerd` starts and exhibits the same behaviour. I suspect this is linked to the kactivities framework, but I'm not sure.
I also tried running `dolphin` in `valgrind` (`valgrind --leak-check=yes dolphin 2>&1 | tee dolphin.log`). The log is attached.

THINGS I TRIED
- reinstalling applications (`pamac reinstall kcoreaddons kconfig5 kactivities5 kactivities-stats5 dolphin kate okular`)
- removing `~/.local/share/kactivitiesmanagerd` and `~/.config/KDE*`
Comment 1 pierreballif.pb+kde 2023-11-27 12:22:58 UTC
- GDB gives the following stack trace:
```
#2  0x00007ffff607c55b in QMimeType::inherits(QString const&) const () at /usr/lib/libQt5Core.so.5
#3  0x00007ffff7422d4c in KBuildSycoca::recreate(bool) () at /usr/lib/libKF5Service.so.5
#4  0x00007ffff740f4ff in KSycocaPrivate::buildSycoca() () at /usr/lib/libKF5Service.so.5
#5  0x00007ffff740f6de in KSycocaPrivate::checkDatabase(QFlags<KSycocaPrivate::BehaviorIfNotFound>) () at /usr/lib/libKF5Service.so.5
#6  0x00007ffff7410963 in KSycoca::ensureCacheValid() () at /usr/lib/libKF5Service.so.5
#7  0x00007ffff73ed7af in KService::serviceByDesktopName(QString const&) () at /usr/lib/libKF5Service.so.5
```
The function `QMimeType::inherits(QString const&) const ()` runs forever and never returns.

- It turns out that one file (`~/.local/share/mime/packages/appimagekit_95f6eff3ef1e2ad046cfd66717eee4da_freedesktop.org.xml`) was responsible for the issue. Deleting or moving the file solves the problem.