SUMMARY This bug report potentially reveals two issues: - An infinite loop in Klipper, if the clip data is an deleted file. - A memleak in Klipper::checkClipData or Klipper::setClipboard when dealing with QMimeData STEPS TO REPRODUCE (0. Optionally start plasmashell with environment variable QT_LOGGING_RULES="org.kde.klipper.debug=true" set) 1. Open Dolphin, create some temporary file. Let's call it "a.txt" 2. "Ctrl+C" this file "a.txt". 3. Now delete the "a.txt" file with "Shift+DEL". 4. Watch the memory consumption of plasmashell grow indefinitely. 5. "Ctrl+C" sth else and observe how the growth stops. OBSERVED RESULT 1. Watch memory consumption of plasmashell grow 2. Qt logging output will yield a loop of the following org.kde.klipper: Checking clip data org.kde.klipper: was empty. Retried, now still empty org.kde.klipper: Resetting clipboard (Prevent empty clipboard) org.kde.klipper: Setting clipboard to < "file:///home/asd/a.txt" > org.kde.klipper: Checking clip data org.kde.klipper: was empty. Retried, now still empty org.kde.klipper: Resetting clipboard (Prevent empty clipboard) org.kde.klipper: Setting clipboard to < "file:///home/asd/a.txt" > org.kde.klipper: Checking clip data org.kde.klipper: was empty. Retried, now still empty org.kde.klipper: Resetting clipboard (Prevent empty clipboard) org.kde.klipper: Setting clipboard to < "file:///home/asd/a.txt" > org.kde.klipper: Checking clip data org.kde.klipper: was empty. Retried, now still empty org.kde.klipper: Resetting clipboard (Prevent empty clipboard) org.kde.klipper: Setting clipboard to < "file:///home/asd/a.txt" > org.kde.klipper: Checking clip data org.kde.klipper: was empty. Retried, now still empty org.kde.klipper: Resetting clipboard (Prevent empty clipboard) org.kde.klipper: Setting clipboard to < "file:///home/asd/a.txt" > EXPECTED RESULT - no memleak in plasmashell SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION Attaching to plasmashell with heaptrack reveals that the leaks come from QMimeData::QMimeData() and QMimeData::setData calls. Unfortunately, the rest of the heaptrack log is not so useful, since heaptrack mixes up symbols for .so files with dwarf version 6 debug info.
*** This bug has been marked as a duplicate of bug 454590 ***
Looking at the supposedly solving fix in https://invent.kde.org/frameworks/kguiaddons/-/commit/04ddcecb5c91a79bce7443e2c43ed93450f435b1 , which was discussed in the bug 455625, it appreas to me that this probably only fixes the memleak. The issue of having an infinite loop in plasma_engine_clipboard.so should then still persist. Hence, I would suggest to reopen the bug.