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

            Bug ID: 527656
           Summary: KDE Connect plasmoid sends endless synchronous DBus
                    property reads ("dismissable") and freezes plasmashell
    Classification: Applications
           Product: kdeconnect
      Version First 26.08.0
       Reported In:
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: plasmoid
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Created attachment 197547
  --> https://bugs.kde.org/attachment.cgi?id=197547&action=edit
log files at the time of the hang-up

With a paired Android phone that has several notifications pending, the KDE
Connect system tray plasmoid can get stuck in an endless loop. It reads the
"dismissable" property of every phone notification over synchronous DBus,
roughly 14,000 calls per second, and never stops.

Because this runs on plasmashell's main thread, plasmashell stops processing
events entirely: the panel, the clock and the task manager freeze, and
plasmashell's org.freedesktop.Notifications service stops replying. Every
other application that tries to show a notification then logs:

  Failed to notify "Did not receive a reply. Possible causes include: the
  remote application did not send a reply, [...] the reply timeout expired
[...]"

In my case this went on for about two days without recovering, roughly 120
such log lines per hour (mostly from kalendarac, also kdeconnectd and kitty).
kquitapp6 and SIGTERM have no effect; only SIGKILL recovers plasmashell.

This looks like the same symptom as bug 474202 (closed as RESOLVED
UNMAINTAINED for lack of a fresh backtrace). The new data below shows it is a
livelock inside the plasmoid, not a deadlock between plasmashell and
kdeconnectd. kdeconnectd is idle and answering every call.

STEPS TO REPRODUCE

I don't have reliable steps. Conditions under which it happened:
1. Pair an Android phone (Samsung S23 Ultra) with KDE Connect and enable the
   notification sync plugin.
2. Leave around 30 phone notifications pending on the desktop.
3. Keep the KDE Connect plasmoid in the system tray. Earlier occurrences
   lined up with the phone's connection repeatedly dropping and reconnecting
   ("Primary Battery seems to have been removed. Suspending packets until it
   is reconnected."), so a notification resync may be the trigger.

OBSERVED RESULT

plasmashell freezes indefinitely, and all desktop notifications time out.

EXPECTED RESULT

The plasmoid reads notification properties a bounded number of times, ideally
asynchronously or cached, and never blocks plasmashell's main thread.

EVIDENCE (captured while frozen, before restart)

1. plasmashell main thread (gdb "thread apply all bt", no debug symbols):

  Thread 1 (LWP 3012) "plasmashell":
  #0  ??? () at /usr/lib/libQt6DBus.so.6
  #1  QDBusMessage::~QDBusMessage() () at /usr/lib/libQt6DBus.so.6
  #2  QDBusAbstractInterfaceBase::qt_metacall(QMetaObject::Call, int, void**)
() at /usr/lib/libQt6DBus.so.6
  #3  QDBusAbstractInterface::qt_metacall(QMetaObject::Call, int, void**) () at
/usr/lib/libQt6DBus.so.6
  #4  ??? () at
/usr/lib/qt6/qml/org/kde/kdeconnect/libkdeconnectdeclarativeplugin.so
  #5  QMetaProperty::read(QObject const*) const () at /usr/lib/libQt6Core.so.6
  #6  QObject::property(char const*) const () at /usr/lib/libQt6Core.so.6
  #7  ??? () at
/usr/lib/qt6/qml/org/kde/kdeconnect/libkdeconnectdeclarativeplugin.so
  #8  ??? () at
/usr/lib/qt6/qml/org/kde/kdeconnect/libkdeconnectdeclarativeplugin.so
  #9  ??? () at /usr/lib/libQt6Qml.so.6

2. kdeconnectd main thread: idle in QCoreApplication::exec() / ppoll, i.e.
   not blocked.

3. The main thread is busy, not blocked: about 15,000 voluntary context
   switches per second, with steady CPU use on the main and QDBusConnection
   threads.

4. dbus-monitor for 2 seconds, filtered on destination org.kde.kdeconnect:
   28,841 method calls. 28,826 of them came from plasmashell (pid 3012), all
   of this form:

     org.freedesktop.DBus.Properties.Get(
       "org.kde.kdeconnect.device.notifications.notification", "dismissable")
     path=/modules/kdeconnect/devices/<device-id>/notifications/N

   They cycle over the same 31 notification objects (N = 1..31) without end.

5. After a SIGKILL and restart of plasmashell, the same 2-second monitor shows
   8 calls in total.

Attachments: full plasmashell and kdeconnectd backtraces, the dbus-monitor
capture, thread states, and the journal around the freeze.

SOFTWARE/OS VERSIONS

Operating System: Manjaro Linux (kernel 6.18.49-1-MANJARO)
Graphics Platform: Wayland
KDE Plasma Version: 6.7.4 (plasma-workspace 6.7.4-3)
KDE Connect: 26.08.0-1
Qt Version: 6.11.2

ADDITIONAL INFORMATION

Workaround: disable the KDE Connect entry under System Tray settings → Entries.
I can provide a backtrace with debug symbols (via debuginfod) the next time it
happens, if that helps.

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

Reply via email to