Summary: | Dolphin hangs when navigating to a directory with any JSON files in it | ||
---|---|---|---|
Product: | [Applications] dolphin | Reporter: | Ilya Bizyaev <bizyaev> |
Component: | general | Assignee: | Dolphin Bug Assignee <dolphin-bugs-null> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | akselmo, fanzhuyifan, faure, jarrodmaddy, kfm-devel, metzelketzer, sayantan.chaudhuri+kde, Thomas.Meschede, utenze.scc |
Priority: | NOR | ||
Version: | 23.08.3 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Ilya Bizyaev
2023-11-20 20:17:33 UTC
Can't reproduce in KDE neon unstable. Maybe it is fixed in plasma 6? I can confirm this behaviour. Not only freezes it Dolphin, it also causes a massive memory leak eating all system resources until it is unresponsive and then crashes the program. It is enough to have a .json file in a folder. No matter if it has content. Even a simple empty test.json triggers the bug. SOFTWARE/OS VERSIONS Operating System: Manjaro KDE Plasma Version: 5.27.9-1 KDE Frameworks Version: 5.112.0-1 Qt Version: 5.15.11+kde+r147-1 Kernel Version: 6.6.3-1-MANJARO Graphics Platform: Wayland Graphics Processor: Navi 32 [Radeon RX 7700 XT / 7800 XT] The problem is somewhere in Frameworks. Other ways to reproduce: * Hover over a JSON filename in Konsole so it tries to display a preview * Download a JSON file with Firefox with plasma-browser-integration so Plasma tries to display a notification about the JSON file * kioclient5 stat test.json I can reproduce this problem with kioclient from Plasma 6 (built with kdesrc-build), so this also affects KF6. I thought as well disabling previews / thumbnails would help since it looked like it was kioslave5 `thumbnail.so` that was eating extreme amounts of memory and taking everything down. however, now instead of only the folders with a .json in it not working, now no folder works and right now i basically completely lost access to dolphin. however, for testing i created a second user on my system and after login i noticed everything works perfectly fine. no problems with dolphin whatsoever. which i tbh can not really explain since obviously both accounts use the same software versions. so the only difference can be in the configuration of those, but the only change on the main account between working and non-working state was the installation of "appimagelauncher" which brings libappimage and squashfuse with it. since the first is used by `kio-extras` to handle appimage thumbnails it is imho a suspect. but removing it did not fix it. and i'm unable to reproduce the problem on a second account so i'm at a loss here what caused it. the last major system update was 22. November, 6 days before i started to notice problems, so as a daily user i have a hard time believing it was caused by something there. it is however consistent with OPs report date. the only other update inbetween, 3 days before the problems was lib32-libxml2, libxml2 and mawk. i also run mesa-git which updates daily. which i thought may be a factor. but downgrading to stable (1.23.1.9) had no effect. So I've debugged this problem, and it is caused by an infinite loop in `QMimeDatabasePrivate::inherits`. The reason is that this method doesn't handle parent-child cycles: for some reason, in my `~/.local/share/mime/` (I didn't even know this directory existed), "application/javascript" was declared a subclass of "application/ecmascript". Normally (`usr/share/mime/packages/freedesktop.org.xml`), it's the other way around, so the combined info created a cycle. Now, I don't know what the solution for this is: * Should Qt learn to handle such cycles? Even if they are maybe not allowed by the spec, getting stuck in an infinite loop with infinite allocations because of a file that users have no knowledge of is not great. * Why was this edge declared in `~/.local/share/mime/` in the first place? Since I've never edited anything in this directory myself, I guess it had been created automatically, so whatever did it can do it again in the future. * Why has this bug never occurred before 20.11.23? Anyway, as a workaround, I deleted `~/.local/share/mime/`, and the issue if gone for now. Oh, I've just figured out the "why now": https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/275 I guess my `~/.local/share/mime/` retained a copy the old declaration, which caused the cycle. So the update of shared-mime-info to 2.4, which I installed on the 20th of November, is the trigger. I'll CC dfaure because he's involved in both projects :) I seem to be encountering this same issue. However, removing my `~/.local/share/mime` didn't rectify the issue as it did for Ilya Bizyaev. Did they run a command after removing that folder? Also checking the copy of the bugged folder there's no reference to application/json or application/ecmascript. My Dolphin version is 23.08.4 # OS information: Operating System: NixOS 24.05 KDE Plasma Version: 5.27.10 KDE Frameworks Version: 5.112.0 Qt Version: 5.15.11 Kernel Version: 6.1.71 (64-bit) Graphics Platform: Wayland More sleuthing with strace against `systemsettings kcm_filetypes` since even trying to change the associations for `json` causes settings to hang: ``` [...clicking around, navigating to json...] readlink("/nix/store/nszw28wv32h9qr2nric9f5f89v7a2cx0-ark-23.08.4/lib/qt-5.15.11/plugins/kf5/parts", 0x7ffeacb63890, 1023) = -1 EINVAL (Invalid argument) readlink("/nix/store/nszw28wv32h9qr2nric9f5f89v7a2cx0-ark-23.08.4/lib/qt-5.15.11/plugins/kf5/parts/arkpart.so", 0x7ffeacb63890, 1023) = -1 EINVAL (Invalid argument) openat(AT_FDCWD, "/nix/store/nszw28wv32h9qr2nric9f5f89v7a2cx0-ark-23.08.4/lib/qt-5.15.11/plugins/kf5/parts/arkpart.so", O_RDONLY|O_CLOEXEC) = 26 statx(26, "", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0555, stx_size=511080, ...}) = 0 statx(26, "", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0555, stx_size=511080, ...}) = 0 mmap(NULL, 511080, PROT_READ, MAP_SHARED, 26, 0) = 0x7fb5cb183000 close(26) = 0 munmap(0x7fb5cb183000, 511080) = 0 brk(0x4370000) = 0x4370000 brk(0x43c9000) = 0x43c9000 brk(0x43ea000) = 0x43ea000 brk(0x440b000) = 0x440b000 [...repeats indefinitely...] ``` And watching the strace when I was clicking on other associations, only `json` casued a large chain of going through all of Nix's stores to collect `kde-mimeapps.list` or `mimeapps.list` before rummaging into `/run/current-system/sw/lib/qt-5.15.11/plugins/kf5/parts` which led to following the link to reach `/nix/store/nszw28wv32h9qr2nric9f5f89v7a2cx0-ark-23.08.4/lib/qt-5.15.11/plugins/kf5/parts/arkpart.so` like we see here. Can't reproduce on Plasma 6, dolphin 24.01.90 Have you read the comments and replicated the setup before attempting to reproduce? @Ilya @Akseli It seems to be what Ilya found which was a bad mime configuration introduced by an update, but for me removing it didn't rectify the issue. And as mentioned, I didn't even have any references to json which made it even weirder. For the sake of time since I do depend on my desktop for work I ended up lifting my user directory out, create an empty user directory, and copy the folders I needed over which got Dolphin, and friends, to stop hanging after dealing with a few confused programs. Of course it merely hides the problem, but the only folders didn't move that are not application specific are `.cache` and `.local`. I'll have to do some binary testing Later™ to scope down the issue when I have the time, though anyone else is free to take the torch since I have a few things pulling for my attention. (In reply to Jarrod Farrell from comment #12) > @Ilya @Akseli > It seems to be what Ilya found which was a bad mime configuration introduced > by an update, but for me removing it didn't rectify the issue. And as > mentioned, I didn't even have any references to json which made it even > weirder. For the sake of time since I do depend on my desktop for work I > ended up lifting my user directory out, create an empty user directory, and > copy the folders I needed over which got Dolphin, and friends, to stop > hanging after dealing with a few confused programs. > > Of course it merely hides the problem, but the only folders didn't move that > are not application specific are `.cache` and `.local`. I'll have to do some > binary testing Later™ to scope down the issue when I have the time, though > anyone else is free to take the torch since I have a few things pulling for > my attention. Check out this issue. They are probably related. https://github.com/nix-community/home-manager/issues/4941 The problem persists, even in a more updated PC with a different OS. SUMMARY Dolphin freezes, then crashes, when browsing the file system it enters a folder that contains files with the extension .json STEPS TO REPRODUCE 1. In a terminal, create in any subfolder of the home a empty file and rename it with .json extension. 2. Open Dolphin and browse to the above folder. OBSERVED RESULT Dolphin should freeze and you will have to kill it. EXPECTED RESULT Other file manager like Gnome "Files" enter normally in the folder SOFTWARE/OS VERSIONS Operating System: Kubuntu 24.04 KDE Plasma Version: 5.27.11 KDE Frameworks Version: 5.115.0 Qt Version: 5.15.13 Kernel Version: 6.8.0-31-generic (64-bit) Graphics Platform: X11 Processors: 4 × Intel® Core™ i5-2400 CPU @ 3.10GHz Memory: 15.5 GiB of RAM Graphics Processor: Mesa Intel® HD Graphics 2000 Manufacturer: Hewlett-Packard Product Name: HP Elite 7300 Series MT System Version: 1.01 |