https://bugs.kde.org/show_bug.cgi?id=455625

            Bug ID: 455625
           Summary: Deleting copied file triggers Klipper::checkClipData
                    -> Klipper::setClipboard -> repeat storm with memleak
                    of QMimeData objects
           Product: plasmashell
           Version: 5.24.4
          Platform: Fedora RPMs
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Clipboard
          Assignee: plasma-b...@kde.org
          Reporter: philipp-...@knechtges.com
  Target Milestone: 1.0

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.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to