[SRU] plasma-discover backends race condition cause GUI not to load

Bug #2063353 reported by Erich Eickmeyer
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
plasma-discover (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

[Impact]

It has been found that under many circumstances, plasma-discover will not load if more than one backend is present. This was first discovered in plasma-discover 6.0 but the same code seems to be also present in plasma-discover 5.27.11. Similar bug fix is found at https://bugs.kde.org/show_bug.cgi?id=481993. For instance, if plasma-discover is loaded with just the packagekit backend, it will load. If it is loaded with just the snap backend, it will load. If it is loaded with both, the GUI will not load.

[Test Case]

From the terminal:

* $ plasma-discover --backends packagekit-backend
* (will load normally)
* $ plasma-discover --backends snap-backend
* (will load normally)
* $ plasma-discover --backends packagekit-backend,snap-backend
* (will fail)

[What could go wrong]

It's possible that, though tested, the fix in the aforementioned bug will not work as it would be a backport from plasma-discover 6.0. However, this seems unlikely as it's highly tested at this point.

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: plasma-discover 5.27.11-0ubuntu2
ProcVersionSignature: Ubuntu 6.8.0-31.31.1-lowlatency 6.8.1
Uname: Linux 6.8.0-31-lowlatency x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.28.1-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: KDE
Date: Wed Apr 24 08:52:15 2024
InstallationDate: Installed on 2024-04-15 (9 days ago)
InstallationMedia: Ubuntu-Studio 24.04 LTS "Noble Numbat" - Beta amd64 (20240410.2)
SourcePackage: plasma-discover
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Erich Eickmeyer (eeickmeyer) wrote :
summary: - [SRU[ plasma-discover backends race condition cause GUI not to load
+ [SRU] plasma-discover backends race condition cause GUI not to load
description: updated
Revision history for this message
Scarlett Gately Moore (scarlettmoore) wrote :

I can't reproduce this on Kubuntu. I tried applying the patch from the bug report and it failed... so I guess this needs further investigation..

Revision history for this message
Scarlett Gately Moore (scarlettmoore) wrote :

I have asked on the upstream bug https://bugs.kde.org/show_bug.cgi?id=481993
My ability to backport that patch is a no go, the code is much to different.

Revision history for this message
Erich Eickmeyer (eeickmeyer) wrote :

Interestingly enough, I cannot reproduce this on a "clean" Ubuntu Studio system or a live .iso of Ubuntu Studio. Only on my existing /home, and even after deleting all configs and cache related to discover.

Revision history for this message
Adrian (adrianboyko) wrote :

I'm having the same problem but I've noticed one marginally interesting point:

plasma-discover --backends snap-backend,packagekit-backend (Works)
plasma-discover --backends packagekit-backend,snap-backend (Does not work)

The only difference is the order of the backends.

Operating System: Kubuntu 24.04
KDE Plasma Version: 5.27.11
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.13
Kernel Version: 6.8.0-31-generic (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-4570 CPU @ 3.20GHz
Memory: 23.4 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 4600
Manufacturer: Hewlett-Packard
Product Name: HP EliteDesk 800 G1 SFF

Revision history for this message
ԜаӀtеr Ⅼарсһуnѕkі (wxl) wrote :

This is a difficult one to reproduce consistently, but it is most certainly an issue.

I had a relatively fresh installation and went through the following to get it to happen (meaning it worked every time until the last line):

plasma-discover --backends packagekit-backend
plasma-discover --backends snap-backend
plasma-discover --backends snap-backend,packagekit-backend
plasma-discover --backends packagekit-backend,snap-backend
plasma-discover
plasma-discover
plasma-discover --backends packagekit-backend,snap-backend

Using a live ISO, I made a little script to continuously run through that pattern and was actually able to get it to fail eventually. I found that the failures only occurred with the packagekit-backend,snap-backend call.

I then modified the script to only do this one call and keep track of the total number of tests and total number of failures (as tested by checking to see if the window was open by grepping for Discover in `wmctrl -lp` after a sensible wait time) and was able to reproduce with some degree of regularity.

In particular, after 300 tests, I had amassed 113 failures, amounting to a 37.7% failure rate.

Definitely a race condition seemingly related to threading if the upstream bug is to be believed.

This is with Lubuntu 24.04 in an X session and a generic kernel, I might add.

Changed in plasma-discover (Ubuntu):
status: New → Confirmed
Revision history for this message
ԜаӀtеr Ⅼарсһуnѕkі (wxl) wrote :

I think I can now report we can reliably repeat this in a live environment.

I re-ran the aforementioned script in a freshly booted live environment (I had been reusing the same one all throughout the chronology of the last comment) and was able to reproduce the behavior, more or less. After 300 tests, I had amassed 103 failures, amounting to a 34.33% failure rate.

It seems you need to run `plasma-discover --backends packagekit-backend,snap-backend` at least 5-6 times before you are going to get a failure.

Revision history for this message
lemmy (lemmyg) wrote :

I recently updated from Kubuntu 23.10 to 24.04 and started to notice this issue. to same issue here with
is random, suddenly will start working.

Revision history for this message
mook765 (mook765) wrote :

I can confirm the statement of Adrian (comment #5).
As a workaround I added the option "--backends snap-backend,packagekit-backend" to the following .deskop-files:
org.kde.discover.apt.urlhandler.desktop
org.kde.discover.desktop
org.kde.discover.snap.desktop
org.kde.discover.urlhandler.desktop

Seems to work properly now, now leftovers in system monitor after closing discover which prevent launching discover's gui before.

OS: Ubuntu Studio 24.04
Kernel 6.8.0-35-lowlatency
Graphics Platform: X11

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.