Bug 393578 - Broken thread use
Summary: Broken thread use
Status: RESOLVED FIXED
Alias: None
Product: kactivitymanagerd
Classification: Unmaintained
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Ivan Čukić
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-27 14:59 UTC by David Edmundson
Modified: 2018-05-17 01:18 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Edmundson 2018-04-27 14:59:53 UTC
The database is opened in the main thread.

ResourceScoreCache::update  runs in another thread. This is not supported and crashes all over the place. 

Database does seem to try and have a per thread thing, but debug shows it doesn't work and even if it did would be working around a problem that shouldn't exist in the first place.

We probably don't see many reports as kactivitymanagerd doesn't link KCrash.
Comment 1 Ivan Čukić 2018-04-27 19:20:30 UTC
Yes, the sqlite driver in Qt was changed not to serialize the database access. Will see what to do...
Comment 2 David Edmundson 2018-04-28 07:42:43 UTC
Didn't realise it was a recent change. Thats kinda good news. I'm on 5.11 beta here.

Personally I'd just drop the thread. Your events come from either dbus which has its own thread and queue, or the xcb qpa which has its own thread and queue. 
Even if the query takes ages it won't cause a noticable problem.

But we can do whatever. Let me know if I can help with anything.
Comment 3 Ivan Čukić 2018-04-28 11:10:42 UTC
Yes, they removed a flag they used to pass to sqlite which made sqlite behave well in a multi-threaded environment (was almost ready to fork the driver like akonadi ppl did when I heard this :) ). IIRC, it was in 5.10.

Anyhow: https://phabricator.kde.org/D12576
Comment 4 Christoph Feck 2018-05-17 01:07:16 UTC
Patch from comment #3 was committed. Did it resolve this issue?
Comment 5 David Edmundson 2018-05-17 01:18:23 UTC
yep