Bug 426963

Summary: kactivitymanagerd continuously crashing
Product: [Plasma] kactivitymanagerd Reporter: Iyán Méndez Veiga <me>
Component: generalAssignee: Ivan Čukić <ivan.cukic>
Status: RESOLVED FIXED    
Severity: normal CC: anonish00, kde, martin.tlustos, plasma-bugs, s_chriscollins, tildearrow
Priority: NOR    
Version: 5.19.90   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Crash report
crash browsing categories in systemsettings

Description Iyán Méndez Veiga 2020-09-25 15:38:32 UTC
Created attachment 131933 [details]
Crash report

SUMMARY

Hi! I'm trying the Plasma 5.20 beta. I love this release! But there is just this  little issue with kactivitymanagerd.

I attach the crash file.


STEPS TO REPRODUCE
1. Start Plasma
2. Sometimes just wait. Other times open some app (e.g. Dolphin)
3. kactivitymanagerd crashes

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Archlinux using [kde-unstable] repo (I just recompiled kactivitymanagerd with debug symbols)
(available in About System)
KDE Plasma Version: 5.19.90
KDE Frameworks Version: 5.74.0
Qt Version: 5.15.1
Comment 1 David Edmundson 2020-09-25 16:05:50 UTC
From the trace presumably

            Q_ASSERT_X(success, "Uils::exec", qPrintable(QStringLiteral("Query failed:") + query.lastError().text()));


Reading the code non debug builds should fail gracefully, so this is relatively low priority.

I would guess it's a corrupt database, but I thought there was now some protection against that?
Comment 2 Iyán Méndez Veiga 2020-09-25 16:44:11 UTC
(In reply to David Edmundson from comment #1)
> Reading the code non debug builds should fail gracefully, so this is
> relatively low priority.

What do you mean by "fail gracefully"? I got the same crash notifications using the non debug build from the Arch repo. I don't notice anything failing after those crashes but it is a bit annoying having those notifications every few minutes.
Comment 3 Ivan Čukić 2020-09-25 17:52:01 UTC
Can you start kactivitymanagerd from shell and post the output here?
Comment 4 Iyán Méndez Veiga 2020-09-25 19:58:08 UTC
(In reply to Ivan Čukić from comment #3)
> Can you start kactivitymanagerd from shell and post the output here?

And how can I do that? I only see kactivities-cli in /usr/bin, not kactivitymanagerd
Comment 5 tildearrow 2020-09-25 23:29:26 UTC
> And how can I do that? I only see kactivities-cli in /usr/bin, not kactivitymanagerd

Confirmed on 5.19.90 as well, under Arch Linux. It happens when starting up Chromium.

You can start kactivitymanagerd manually by doing:
> killall kactivitymanagerd; /usr/lib/kactivitymanagerd

The output for me is:

```
org.kde.kactivities.resources: "INSERT INTO ResourceEvent        (usedActivity,  initiatingAgent,  targettedResource,  start,  end) VALUES (:usedActivity, :initiatingAgent, :targettedResource, :start, :end)"
org.kde.kactivities.resources: QSqlError("11", "Unable to fetch row", "database disk image is malformed")
org.kde.kactivities.resources: "SELECT start, end FROM ResourceEvent WHERE :usedActivity      = usedActivity AND :initiatingAgent   = initiatingAgent AND :targettedResource = targettedResource AND start > :start ORDER BY start ASC"
org.kde.kactivities.resources: QSqlError("11", "Unable to fetch row", "database disk image is malformed")
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = kactivitymanagerd path = /usr/lib pid = 268951
KCrash: Arguments: /usr/lib/kactivitymanagerd 
KCrash: Attempting to start /usr/lib/drkonqi
```
Comment 6 Ivan Čukić 2020-09-26 10:51:58 UTC
Thanks.

Seems that database disk corruption can be exposed randomly during work.

KAMD performs some tests on startup and restores the last database known to work. But it does not cover these errors.

Will see how to handle these.
Comment 7 S. Christian Collins 2020-10-13 15:19:41 UTC
Created attachment 132325 [details]
crash browsing categories in systemsettings

After upgrading KDE neon User Edition to Plasma 5.20, kactivitymanagerd crashes constantly on my system. Open Dolphin: crash. Browse through System Settings: crash, crash, crash. I have attached the backtrace here. Anybody know a workaround for this?
Comment 8 S. Christian Collins 2020-10-13 23:16:12 UTC
I was able to stop the crashes by deleting the ~/.local/kactivitymanagerd folder. Then I just had to recreate my favorites in the application launcher.
Comment 9 Albert 2020-10-14 23:27:33 UTC
https://bugs.kde.org/show_bug.cgi?id=427650#c1

that patch fixed it for me
Comment 10 Iyán Méndez Veiga 2020-12-18 22:16:20 UTC
I didn't have this issue again. You can close the bug.