Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 814284 - kde-plasma/plasma-workspace-5.22.5: Fix notification for attached hotplug devices
Summary: kde-plasma/plasma-workspace-5.22.5: Fix notification for attached hotplug dev...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Stabilization (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords: CC-ARCHES, UPSTREAM
Depends on:
Blocks:
 
Reported: 2021-09-22 00:07 UTC by Eric F. GARIOUD
Modified: 2021-10-13 03:55 UTC (History)
2 users (show)

See Also:
Package list:
kde-plasma/plasma-workspace-5.22.5-r2
Runtime testing required: ---
nattka: sanity-check+


Attachments
Patch fixing notification of hotplug devices (plasma-workspace-5.22.5-fix-connectedsources-update-on-hotplug.patch,677 bytes, patch)
2021-09-22 00:13 UTC, Eric F. GARIOUD
no flags Details | Diff
plasma-workspace ebuild implementing the above patch (plasma-workspace-5.22.5-r2.ebuild,6.15 KB, text/plain)
2021-09-22 00:21 UTC, Eric F. GARIOUD
no flags Details
plasma-workspace-5.22.5-fix-removable-device-eject-crash.patch (plasma-workspace-5.22.5-fix-removable-device-eject-crash.patch,7.54 KB, patch)
2021-09-23 06:37 UTC, Andreas Sturmlechner
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric F. GARIOUD 2021-09-22 00:07:45 UTC
Since kde-plasma/plasma-workspace-5.22.5, the device notifier will wake up on ly the first time an usb key is attached.
Il that device is then detached, the device notifier will remain silent for all future attachements.

This bug has been reported on the KDE Bugtracking System : https://bugs.kde.org/show_bug.cgi?id=438874

A fix has been merged upstream : https://invent.kde.org/plasma/plasma-workspace/-/commit/61e2ea2323ae63c5805c87353701ba6fb722205a

Works for me.

Reproducible: Always
Comment 1 Eric F. GARIOUD 2021-09-22 00:13:46 UTC
Created attachment 740622 [details, diff]
Patch fixing notification of hotplug devices

This patch is a copy of upstream's patch adapted to the version of applets/devicenotifier/package/contents/ui/devicenotifier.qml found in plasma-workspace-5.22.5.tar.xz distfile.
Comment 2 Eric F. GARIOUD 2021-09-22 00:21:50 UTC
Created attachment 740625 [details]
plasma-workspace ebuild implementing the above patch

Ebuild taking the patch into account.
Comment 3 Larry the Git Cow gentoo-dev 2021-09-22 21:59:28 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=61988d92de81544b00167a289258360b61c7261e

commit 61988d92de81544b00167a289258360b61c7261e
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2021-09-22 20:53:47 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2021-09-22 21:59:09 +0000

    kde-plasma/plasma-workspace: Fix krunner cwd, device notifications
    
    krunner starts applications with cwd "/" with init system other than systemd
    KDE-bug: https://bugs.kde.org/show_bug.cgi?id=432975
    
    Disk & Devices applet doesn't show removable devices after eject and reconnect
    Upstream commit 61e2ea2323ae63c5805c87353701ba6fb722205a
    KDE-bug: https://bugs.kde.org/show_bug.cgi?id=438874
    
    Thanks-to: Eric F. Garioud <eric-f.garioud@wanadoo.fr>
    Thanks-to: Andrea Arcangeli <aarcange@redhat.com>
    Bug: https://bugs.gentoo.org/767478
    Bug: https://bugs.gentoo.org/814284
    Package-Manager: Portage-3.0.23, Repoman-3.0.3
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>

 ...orkspace-5.22.5-fix-hotplug-notifications.patch |  33 ++++
 ...asma-workspace-5.22.5-krunner-cwd-at-home.patch |  30 +++
 .../plasma-workspace-5.22.5-r2.ebuild              | 210 +++++++++++++++++++++
 3 files changed, 273 insertions(+)
Comment 4 Michael 2021-09-23 00:27:36 UTC
With the latest fix I can crash plasma by ejecting a usb thumbdrive.
Comment 5 Andreas Sturmlechner gentoo-dev 2021-09-23 06:37:56 UTC
Created attachment 740790 [details, diff]
plasma-workspace-5.22.5-fix-removable-device-eject-crash.patch

So, unfortunately I can not reproduce this kind of crash with any of my devices. I will rely on your testing to confirm that the attached patch fixes it.

This patch contains both the additional upstream commit 89c719113193a29bd608163a6f4d81e23e2a5513 from the linked MR as well as preceding commit cfbb1995ebd33ec3c49727b62713c81c3c7526d8 which is touching the same context in order to fix a duplicate bug of KDEbug 438874.
Comment 6 Michael 2021-09-23 06:51:11 UTC
I tested the patch, it still crashes in the same way. What's interesting is that it doesn't crash if I eject the device from Dolphin, only if I do that from the device-notificator-applet-what's its name
Comment 7 Michael 2021-09-23 07:01:10 UTC
Application: Plasma (plasmashell), signal: Segmentation fault

[KCrash Handler]
#4  0x00007f9b6c2059de in  () at /usr/lib64/libQt5Qml.so.5
#5  0x00007f9b6c1aca94 in  () at /usr/lib64/libQt5Qml.so.5
#6  0x00007f9b6c1ae24d in QQmlVMEMetaObject::metaCall(QObject*, QMetaObject::Call, int, void**) () at /usr/lib64/libQt5Qml.so.5
#7  0x00007f9b6c0e457d in  () at /usr/lib64/libQt5Qml.so.5
#8  0x00007f9b5064d2d3 in  ()
#9  0x0000000000000000 in  ()
[Inferior 1 (process 14389) detached]
Comment 8 Eric F. GARIOUD 2021-09-23 08:26:47 UTC
(In reply to Michael from comment #6)
> I tested the patch, it still crashes in the same way. What's interesting is
> that it doesn't crash if I eject the device from Dolphin, only if I do that
> from the device-notificator-applet-what's its name

Which patch did you test ?
The one I posted in the first attachment (changing only 2 lines in a single .qml file and which should be sufficient for fixing the bug I reported here) or asturm's one going much farther ?

In the latter case, could you please test the first patch attached to this bug report ?
Comment 9 Michael 2021-09-23 09:23:50 UTC
I tested attachment 740790 [details, diff] applied to plasma-workspace-5.22.5-r2, which should already have the other one, if I understood you correctly. 

However. Upgrading to 5.22.90 from ::kde fixed my issue. And moreover, after some additional testing and recompiling plasma several times, I suspect that the crash that I was experiencing has nothing to do with this bug, so sorry for the noise.
Comment 10 Eric F. GARIOUD 2021-09-23 14:17:54 UTC
(In reply to Michael from comment #9)
> ...I suspect that
> the crash that I was experiencing has nothing to do with this bug.

I share this opinion, at least as far as devicenotifier.qml is concerned.
Because at the end of the day, there should be no difference (for this file) between plasma-workspace-5.22.5-r2 patched with asturm's last attachment and the 5.23 beta (5.22.90) version.

AFAIU The first patch (from attachement 740790) only fixes very particular cases where unmounting via the applet generates a crash (cases in which you are unlikely to be as it would not have been possible for you to umount from dolphin) and the second just rewrites the logic of the first.

And indeed, all these fiddlings (while possibly being of non negligible interest in some cases) are not in the scope of this precise bug.
Comment 11 Eric F. GARIOUD 2021-09-23 14:35:10 UTC
(In reply to Larry the Git Cow from comment #3)
> The bug has been referenced in the following commit(s):
> 
> https://gitweb.gentoo.org/repo/gentoo.git/commit/
> ?id=61988d92de81544b00167a289258360b61c7261e
> 
> commit 61988d92de81544b00167a289258360b61c7261e
> Author:     Andreas Sturmlechner <asturm@gentoo.org>
> AuthorDate: 2021-09-22 20:53:47 +0000
> Commit:     Andreas Sturmlechner <asturm@gentoo.org>
> CommitDate: 2021-09-22 21:59:09 +0000

Thank you Andreas! This commit actually resolves/fixes this bug.
Comment 12 Andreas Sturmlechner gentoo-dev 2021-09-23 16:01:19 UTC
We'll use this bug for stabilisation.
Comment 13 Sam James archtester gentoo-dev Security 2021-10-02 22:49:53 UTC
amd64 done
Comment 14 Agostino Sarubbo gentoo-dev 2021-10-06 06:48:09 UTC
x86 stable
Comment 15 Sam James archtester gentoo-dev Security 2021-10-13 03:55:15 UTC
arm64 done

all arches done