[frameworks-solid] [Bug 398908] Dolphin uses up huge amounts of memory over time

Méven Car bugzilla_noreply at kde.org
Thu Feb 3 10:13:15 GMT 2022


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

Méven Car <meven29 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Product|frameworks-kio              |frameworks-solid
          Component|general                     |general
           Assignee|kio-bugs-null at kde.org       |lukas at kde.org

--- Comment #116 from Méven Car <meven29 at gmail.com> ---
Thank you Alexander Meshcheryakov , traces are of great quality.

It confirms my hypothesis, the leak seem to happen whenever solid is asked to
get the filepath of a luks encrypted udisk2 mount.

I could not figure out precisely the leak origin.
It seems to happen in Solid::Backends::UDisk2::Device::Device when called from
Solid::Backends::UDisk2::StorageAccess::clearTextPath()

The connection there seem to not be cleaned after the short-lived Device is
deleted, but I am not sure of my interpretation as it does not make much sense.

I have this patch that should help, although I can't guarantee it:

diff --git src/solid/devices/backends/udisks2/udisksstorageaccess.cpp
src/solid/devices/backends/udisks2/udisksstorageaccess.cpp
index 389832b..da1dbcc 100644
--- src/solid/devices/backends/udisks2/udisksstorageaccess.cpp
+++ src/solid/devices/backends/udisks2/udisksstorageaccess.cpp
@@ -6,6 +6,7 @@
 */

 #include "udisksstorageaccess.h"
+#include "udisksdevicebackend.h"
 #include "udisks2.h"
 #include "udisks_debug.h"

@@ -376,9 +377,9 @@ QString StorageAccess::clearTextPath() const
             QDomElement nodeElem = nodeList.item(i).toElement();
             if (!nodeElem.isNull() && nodeElem.hasAttribute("name")) {
                 const QString udi = prefix + "/" + nodeElem.attribute("name");
-                Device holderDevice(udi);
+                DeviceBackend* backend = DeviceBackend::backendForUDI(udi);

-                if (m_device->udi() ==
holderDevice.prop("CryptoBackingDevice").value<QDBusObjectPath>().path()) {
+                if (m_device->udi() ==
backend->property("CryptoBackingDevice").value<QDBusObjectPath>().path()) {
                     // qDebug() << Q_FUNC_INFO << "CLEARTEXT device path: " <<
udi;
                     return udi;
                 }


I could not test it as I am not sure how to setup an environment to trigger the
bug.

So Alexander Meshcheryakov or someone else affected, feel free to compile and
install solid with this to test.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the kfm-devel mailing list