SUMMARY There are some applications that have buggy file-opening or handling, and they manage to set the mimetype to open with "xdg-open" or "kde-open." This causes the file to open inside a recursive loop, eating CPU and causing sad times. The application that was reported to me is called `p4v` and apparently that has a bug like this. I haven't been able to test it in the application itself since it is proprietary + costs big money. It is an application side bug, but we should still handle these situations gracefully to avoid users PC to be in weird place. STEPS TO REPRODUCE 1. Create empty file 2. Set that file to always open with `xdg-open` or `kde-open` 3. Try opening the file with `xdg-open` or `kde-open` inside terminal 4. Try opening the file from Dolphin by clicking on it OBSERVED RESULT CPU spiking to 100%, user has to run `killall kde-open` in terminal to get rid of it EXPECTED RESULT We would get the open-with dialog instead SOFTWARE/OS VERSIONS Operating System: Fedora Linux 40 KDE Plasma Version: 6.2.80 KDE Frameworks Version: 6.7.0 Qt Version: 6.7.2 Kernel Version: 6.10.12-200.fc40.x86_64 (64-bit) Graphics Platform: Wayland Processors: 12 × AMD Ryzen 5 3600 6-Core Processor Memory: 15,5 GiB of RAM Graphics Processor: AMD Radeon RX 6600
I've also made a relevant merge request: https://invent.kde.org/frameworks/kservice/-/merge_requests/186
Git commit 4fbda144ab4b77a2d99eb0dca1ff3cf75957cf55 by Akseli Lahtinen. Committed on 14/10/2024 at 08:37. Pushed by akselmo into branch 'master'. openurljob.cpp: Avoid opening files in endless loop if mimetype is set to open with xdg-open Some applications set their file mimetypes to open with "xdg-open" which then causes it open in "kde-open", which then ends up calling itself constantly and endlessly, spiking CPU. Instead, catch that early on and show the "Open with dialog", so we handle the file like it has no set default application. M +7 -0 src/gui/openurljob.cpp https://invent.kde.org/frameworks/kio/-/commit/4fbda144ab4b77a2d99eb0dca1ff3cf75957cf55