Bug 389640 - kactivitymanagerd crashes if libQt5Sql5-sqlite is not installed
Summary: kactivitymanagerd crashes if libQt5Sql5-sqlite is not installed
Status: RESOLVED DUPLICATE of bug 389441
Alias: None
Product: kactivitymanagerd
Classification: Plasma
Component: general (show other bugs)
Version: 5.11.95
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Ivan Čukić
URL: http://bugzilla.opensuse.org/show_bug...
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-30 11:23 UTC by Wolfgang Bauer
Modified: 2018-03-10 19:08 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Bauer 2018-01-30 11:23:50 UTC
If Qt's SQLite plugin is not installed, kactivitymanagerd just crashes and keeps restarting again and again.

Output in the shell:
Config timer connecting...
Setting the name of  0xaa4a80  to  "org.kde.ActivityManager.RunApplication"
Setting the name of  0xa89e70  to  "org.kde.ActivityManager5.ActivityTemplates"
Setting the name of  0xab8c40  to  "org.kde.ActivityManager5.Resources.Scoring"
Creating directory:  "/home/wolfi/.local/share/kactivitymanagerd/resources/"
QSqlDatabase: QSQLITE driver not loaded
QSqlDatabase: available drivers: QSQLITE3 QMYSQL QMYSQL3
KActivities: Database is not open:  "kactivities_db_resources_140269434763136_readwrite" "" QSqlError("", "Driver not loaded", "Driver not loaded")
KActivities: Opening the database in RW mode should always succeed
Service started, version: 
Cleaning up...
(at that point the shell prompt reappears, but kactivitymanagerd is crashing and restarting again and again in the background)

Unfortunately, I wasn't able to get a meaningful backtrace:
Core was generated by `/usr/bin/kactivitymanagerd start-daemon'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007eff5b4aa8c7 in ?? ()
[Current thread is 1 (LWP 13270)]
(gdb) bt
#0  0x00007eff5b4aa8c7 in ?? ()
#1  0x00007eff5b4abc9a in ?? ()
#2  0x0000000000000020 in ?? ()
#3  0x0000000000000000 in ?? ()

Note that it works fine if libQt5Sql5-sqlite is installed.

We added a Requires now to the openSUSE package to avoid this situation (the SQL plugin was only recommended before), but kactivitymanagerd should handle this more gracefully I think.

PS: the endless restarts are caused by the autostart D-BUS service (/usr/share/dbus-1/services/org.kde.activitymanager.service), removing it fixes that problem at least
Comment 1 Ivan Čukić 2018-03-07 22:32:58 UTC
I'm not convinced that a bad installation/setup can be handled more gracefully than showing the exact error in the output.

The question I have is what driver is QSQLITE3 in opensuse's Qt packaging - I'm asking because it does not exist in the Qt's docs [1] - only QSQLITE2 and QSQLITE exist, where the QSQLITE driver handles sqlite 3 and above.

[1] http://doc.qt.io/qt-5/sql-driver.html
Comment 2 Wolfgang Bauer 2018-03-10 14:43:49 UTC
(In reply to Ivan Čukić from comment #1)
> I'm not convinced that a bad installation/setup can be handled more
> gracefully than showing the exact error in the output.

The problem is that the system is more or less unusable though (because kactivitymanagerd keeps restarting and crashing endlessly, and systemd-coredump creates one coredump after the other), and the user won't see the output anyway of course.

Similar things happen when the database gets corrupted btw, there were a few users having that problem recently, e.g.:
https://forums.opensuse.org/showthread.php/530020-Help-working-process-quot-system-coredump-quot

> The question I have is what driver is QSQLITE3 in opensuse's Qt packaging -
> I'm asking because it does not exist in the Qt's docs [1] - only QSQLITE2
> and QSQLITE exist, where the QSQLITE driver handles sqlite 3 and above.

That's the one from akonadi, which I happen to have installed.

libQt5Sql5-sqlite OTOH contains the standard one from qtbase, with that installed it works (unless the database is corrupted or similar).
Comment 3 Ivan Čukić 2018-03-10 19:08:03 UTC
Ok, that explains things.

As for the assert, yes it needs to go away. I expected sqlite to be stable enough not to have these issues (thus asserting and qFataling on errors).

I'll close this issue - the database corruption issue is tracked in the https://bugs.kde.org/show_bug.cgi?id=389441

*** This bug has been marked as a duplicate of bug 389441 ***