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

            Bug ID: 527119
           Summary: smbnotifier never reads its D-Bus messages, fills the
                    session bus quota, and disconnects plasmashell and
                    kwin
    Classification: Frameworks and Libraries
           Product: kio-extras
      Version First 26.08.2
       Reported In:
          Platform: CachyOS
                OS: Linux
            Status: REPORTED
          Severity: crash
          Priority: NOR
         Component: Samba
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

DESCRIPTION
smbnotifier blocks its main thread in smbc_notify() and never reaches
app.exec(), but it stays connected to the session bus with match rules from
KPasswdServerClient (NameOwnerChanged for org.kde.kpasswdserver6,
org.kde.KPasswdServer.checkAuthInfoAsyncResult). Messages that match those
rules queue up in dbus-broker and are never read. With several notifiers
running, the backlog filled the per-user bus quota and dbus-broker disconnected
other clients, including plasmashell and kwin_wayland.

STEPS TO REPRODUCE
1. Open several smb:// folders on a Windows file server in Dolphin and leave
them open.
2. Keep using the share from Dolphin and other KIO clients for a few hours.
3. Check the smbnotifier peers with: busctl --user call org.freedesktop.DBus
/org/freedesktop/DBus org.freedesktop.DBus.Debug.Stats GetStats

I could not reproduce this on demand. It happened once after about 4.5 h of
uptime.

OBSERVED RESULT
Six smbnotifier processes (one per open SMB folder) each had about 45 MB of
OutgoingBytes queued in dbus-broker and 2 match rules. Together they used up
the bytes quota for my UID:

  dbus-broker: UID 1000 exceeded its 'bytes' quota on UID 1000.
  dbus-broker: Peer :1.424 is being disconnected as it does not have the
resources to receive a signal it subscribed to.

plasmashell, kwin_wayland (org.kde.KWin and org.kde.kglobalaccel were left
without an owner) and powerdevil were disconnected. plasmashell exited with
status 0, so systemd did not restart it and the panel and desktop disappeared.
Killing the smbnotifier processes freed the quota, and plasmashell could then
be started again.

EXPECTED RESULT
smbnotifier should not build up an unbounded D-Bus backlog. For example, it
could remove match rules it no longer needs after authentication, or keep
reading the bus on a separate thread. One stuck helper should not be able to
disconnect the shell and compositor.

SOFTWARE/OS VERSIONS
Operating System: CachyOS Linux, kernel 7.2.10-1-cachyos, Wayland
KDE Plasma Version: 6.7.5
KDE Frameworks Version: 6.31.0
Qt Version: 6.12.0
kio-extras 26.08.2, smbclient 4.25.0, dbus-broker as the session bus

ADDITIONAL INFORMATION
I did not confirm which messages made up the backlog. checkAuthInfoAsyncResult
is the likely candidate because it is broadcast for every password check on the
share. A notifier started by hand from a terminal now exits at once with
"Failed to smbc_opendir: Invalid argument", so I could not inspect a stuck one
again.

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

Reply via email to