https://bugs.kde.org/show_bug.cgi?id=500892
Bug ID: 500892 Summary: Kate allocates all system memory until system crash or OOM-killed in certain situations involving symlinks Classification: Applications Product: kate Version: unspecified Platform: Arch Linux OS: Linux Status: REPORTED Severity: critical Priority: NOR Component: general Assignee: kwrite-bugs-n...@kde.org Reporter: thatk...@gmail.com Target Milestone: --- SUMMARY When using the Open Folder (Ctrl+T) mode, Kate appears to attempt to load large directories multiple times for each symlink that points to it, potentially consuming all available system memory until system crash or OOM-killed. On my setup, I have my old Windows SSD mounted on at /mnt/c/. This is a large directory, and if I target it with Kate's Open Folder feature, Kate allocates approximately 2 GB of memory to fully load it (this seems very excessive on its own!). However, I have programs like Wine, Proton, and Lutris installed, and each of these can sometimes create multiple WINEPREFIX directories, which each contain a Z: symlink, which points to my Linux drive, which contains /mnt/c/. For each of these WINEPREFIX directories, I believe it's trying to load the entire filesystem, /mnt/c/ and all, over and over again. Given that Proton on Steam alone currently has 26 of these WINEPREFIX directories, this means that Kate will attempt to fully load these directories over and over again, crashing any system that has under 50 or so free gigabytes of free memory (which will be most of them). Now that I think about it, the /mnt/c/ situation may not even be necessary. If a symlink points to the system's root directory, it may try to recursively reload the entire filesystem again every time it reaches that symlink. However, given how common Wine is, I feel like this problem would have been encountered long ago if it were that simple. In any case, I feel like there should be some kind of brake in Kate that stops it from allocating an unreasonable amount of memory regardless of the filesystem setup. STEPS TO REPRODUCE 1. Open a WINEPREFIX directory (specifically, the dosdevices directory) while a large drive is mounted to the filesystem. 2. Wait until Kate allocates all remaining system memory (or a very large portion of it), crashing the system or being OOM-killed. OBSERVED RESULT The system crashes or Kate is OOM-killed. EXPECTED RESULT The directory listing is displayed in the folder panel. SOFTWARE/OS VERSIONS Operating System: EndeavourOS KDE Plasma Version: 6.3.2 KDE Frameworks Version: 6.11.0 Qt Version: 6.8.2 -- You are receiving this mail because: You are watching all bug changes.