Bug 470219

Summary: krunner sometimes crashes in MathStructure::setAborted() after typing a few numbers/letters
Product: [Plasma] krunner Reporter: Sean <kde>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: crash CC: alexander.lohnau, d7ghrrkcz, efoley92, natalie_clarius, nate, rybak.a.v, szotsaki, vitto88
Priority: HI Keywords: drkonqi
Version: 5.27.5   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=470312
Latest Commit: Version Fixed In: 5.27.6
Sentry Crash Report:

Description Sean 2023-05-24 15:38:46 UTC
Application: krunner (5.27.5)

Qt Version: 5.15.9
Frameworks Version: 5.106.0
Operating System: Linux 6.3.3-arch1-1 x86_64
Windowing System: X11
Distribution: "Arch Linux"
DrKonqi: 5.27.5 [KCrashBackend]

-- Information about the crash:
krunner often crashes after a few numbers are typed in. Occasionally it works completely fine. This seems to happen regardless of whether krunner is invoked via Alt+Space or `krunner` in a terminal.

The crash can be reproduced sometimes.

-- Backtrace:
Application: KRunner (krunner), signal: Segmentation fault

[KCrash Handler]
#4  0x00007f1990c5bc54 in MathStructure::clear(bool) () at /usr/lib/libqalculate.so.22
#5  0x00007f1990c5c257 in MathStructure::setAborted(bool) () at /usr/lib/libqalculate.so.22
#6  0x00007f1990bc3746 in CalculateThread::run() () at /usr/lib/libqalculate.so.22
#7  0x00007f1990c76113 in Thread::doRun(void*) () at /usr/lib/libqalculate.so.22
#8  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#9  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 33 (Thread 0x7f1906bfe6c0 (LWP 7351) "Thread (pooled)"):
#1  0x00007f19ace9cab5 in pthread_cond_timedwait () at /usr/lib/libc.so.6
#2  0x00007f19ad4fadf4 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/libQt5Core.so.5
#3  0x00007f19ad4f7f2a in  () at /usr/lib/libQt5Core.so.5
#4  0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#5  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#6  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 32 (Thread 0x7f19073ff6c0 (LWP 7350) "Thread (pooled)"):
#1  0x00007f19ace9cab5 in pthread_cond_timedwait () at /usr/lib/libc.so.6
#2  0x00007f19ad4fadf4 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/libQt5Core.so.5
#3  0x00007f19ad4f7f2a in  () at /usr/lib/libQt5Core.so.5
#4  0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#5  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#6  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 31 (Thread 0x7f19349ef6c0 (LWP 7349) "gmain"):
#1  0x00007f19abd6c17f in  () at /usr/lib/libglib-2.0.so.0
#2  0x00007f19abd0e1a2 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#3  0x00007f19abd0e1f2 in  () at /usr/lib/libglib-2.0.so.0
#4  0x00007f19abd3c315 in  () at /usr/lib/libglib-2.0.so.0
#5  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#6  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 30 (Thread 0x7f1937fff6c0 (LWP 7336) "GlobalQueue[24]"):
#1  0x00007f19ad4eea76 in QBasicMutex::lockInternal() () at /usr/lib/libQt5Core.so.5
#2  0x00007f19ad4eec53 in QMutex::lock() () at /usr/lib/libQt5Core.so.5
#3  0x00007f19ad4f7188 in QReadWriteLock::tryLockForRead(int) () at /usr/lib/libQt5Core.so.5
#4  0x00007f19aeef5b0d in  () at /usr/lib/libQt5DBus.so.5
#5  0x00007f19aeeecfe9 in QDBusConnection::asyncCall(QDBusMessage const&, int) const () at /usr/lib/libQt5DBus.so.5
#6  0x00007f199d395220 in  () at /usr/lib/libKF5Runner.so.5
#7  0x00007f199d39ebd0 in  () at /usr/lib/libKF5Runner.so.5
#8  0x00007f199ff8b7de in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#9  0x00007f199ff8c726 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#10 0x00007f199ff90442 in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#11 0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#12 0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#13 0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 29 (Thread 0x7f193cff96c0 (LWP 7335) "GlobalQueue[23]"):
#1  0x00007f19ad4ef47c in QSemaphore::acquire(int) () at /usr/lib/libQt5Core.so.5
#2  0x00007f19ad6cfebe in  () at /usr/lib/libQt5Core.so.5
#3  0x00007f19aeefcdd5 in QDBusAbstractInterface::connectNotify(QMetaMethod const&) () at /usr/lib/libQt5DBus.so.5
#4  0x00007f19ad6cddd1 in QObjectPrivate::connectImpl(QObject const*, int, QObject const*, void**, QtPrivate::QSlotObjectBase*, Qt::ConnectionType, int const*, QMetaObject const*) () at /usr/lib/libQt5Core.so.5
#5  0x00007f19ad6ce15e in QObject::connectImpl(QObject const*, void**, QObject const*, void**, QtPrivate::QSlotObjectBase*, Qt::ConnectionType, int const*, QMetaObject const*) () at /usr/lib/libQt5Core.so.5
#6  0x00007f19919dcc17 in KActivities::Stats::ResultWatcher::ResultWatcher(KActivities::Stats::Query, QObject*) () at /usr/lib/libKF5ActivitiesStats.so.1
#7  0x00007f19919dddd5 in  () at /usr/lib/libKF5ActivitiesStats.so.1
#8  0x00007f19919eda5c in KActivities::Stats::ResultModel::ResultModel(KActivities::Stats::Query, QObject*) () at /usr/lib/libKF5ActivitiesStats.so.1
#9  0x00007f199c045ff1 in  () at /usr/lib/qt/plugins/kf5/krunner/krunner_recentdocuments.so
#10 0x00007f199d39ebd0 in  () at /usr/lib/libKF5Runner.so.5
#11 0x00007f199ff8b7de in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#12 0x00007f199ff8c726 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#13 0x00007f199ff90442 in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#14 0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#15 0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#16 0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 28 (Thread 0x7f193d7fa6c0 (LWP 7334) "GlobalQueue[22]"):
#1  0x00007f19ace9c7a0 in pthread_cond_wait () at /usr/lib/libc.so.6
#2  0x00007f19ad4fae64 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/libQt5Core.so.5
#3  0x00007f199ff93e36 in ThreadWeaver::Weaver::takeFirstAvailableJobOrSuspendOrWait(ThreadWeaver::Thread*, bool, bool, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#4  0x00007f199ff9407f in  () at /usr/lib/libKF5ThreadWeaver.so.5
#5  0x00007f199ff92976 in ThreadWeaver::Weaver::applyForWork(ThreadWeaver::Thread*, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#6  0x00007f199ff9039e in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#7  0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#8  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#9  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 27 (Thread 0x7f193dffb6c0 (LWP 7333) "GlobalQueue[21]"):
#1  0x00007f19ace9c7a0 in pthread_cond_wait () at /usr/lib/libc.so.6
#2  0x00007f19ad4fae64 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/libQt5Core.so.5
#3  0x00007f199ff93e36 in ThreadWeaver::Weaver::takeFirstAvailableJobOrSuspendOrWait(ThreadWeaver::Thread*, bool, bool, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#4  0x00007f199ff9407f in  () at /usr/lib/libKF5ThreadWeaver.so.5
#5  0x00007f199ff92976 in ThreadWeaver::Weaver::applyForWork(ThreadWeaver::Thread*, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#6  0x00007f199ff9039e in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#7  0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#8  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#9  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 26 (Thread 0x7f193e7fc6c0 (LWP 7332) "GlobalQueue[20]"):
#1  0x00007f19ace9c7a0 in pthread_cond_wait () at /usr/lib/libc.so.6
#2  0x00007f19ad4fae64 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/libQt5Core.so.5
#3  0x00007f19aef28ed6 in  () at /usr/lib/libQt5DBus.so.5
#4  0x00007f19aef28f26 in QDBusPendingCallWatcher::waitForFinished() () at /usr/lib/libQt5DBus.so.5
#5  0x00007f199d3954fe in  () at /usr/lib/libKF5Runner.so.5
#6  0x00007f199d39ebd0 in  () at /usr/lib/libKF5Runner.so.5
#7  0x00007f199ff8b7de in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#8  0x00007f199ff8c726 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#9  0x00007f199ff90442 in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#10 0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#11 0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#12 0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 25 (Thread 0x7f193effd6c0 (LWP 7331) "GlobalQueue[19]"):
#1  0x00007f19ace9c7a0 in pthread_cond_wait () at /usr/lib/libc.so.6
#2  0x00007f19ad4fae64 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/libQt5Core.so.5
#3  0x00007f199ff93e36 in ThreadWeaver::Weaver::takeFirstAvailableJobOrSuspendOrWait(ThreadWeaver::Thread*, bool, bool, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#4  0x00007f199ff9407f in  () at /usr/lib/libKF5ThreadWeaver.so.5
#5  0x00007f199ff92976 in ThreadWeaver::Weaver::applyForWork(ThreadWeaver::Thread*, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#6  0x00007f199ff9039e in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#7  0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#8  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#9  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 24 (Thread 0x7f193f7fe6c0 (LWP 7330) "GlobalQueue[18]"):
#1  0x00007f19ace9c7a0 in pthread_cond_wait () at /usr/lib/libc.so.6
#2  0x00007f19ad4fae64 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/libQt5Core.so.5
#3  0x00007f199ff93e36 in ThreadWeaver::Weaver::takeFirstAvailableJobOrSuspendOrWait(ThreadWeaver::Thread*, bool, bool, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#4  0x00007f199ff9407f in  () at /usr/lib/libKF5ThreadWeaver.so.5
#5  0x00007f199ff92976 in ThreadWeaver::Weaver::applyForWork(ThreadWeaver::Thread*, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#6  0x00007f199ff9039e in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#7  0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#8  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#9  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 23 (Thread 0x7f19377fe6c0 (LWP 7329) "GlobalQueue[17]"):
#1  0x00007f19ace9c7a0 in pthread_cond_wait () at /usr/lib/libc.so.6
#2  0x00007f19ad4fae64 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/libQt5Core.so.5
#3  0x00007f199ff93e36 in ThreadWeaver::Weaver::takeFirstAvailableJobOrSuspendOrWait(ThreadWeaver::Thread*, bool, bool, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#4  0x00007f199ff9407f in  () at /usr/lib/libKF5ThreadWeaver.so.5
#5  0x00007f199ff92976 in ThreadWeaver::Weaver::applyForWork(ThreadWeaver::Thread*, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#6  0x00007f199ff9039e in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#7  0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#8  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#9  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 22 (Thread 0x7f193ffff6c0 (LWP 7328) "GlobalQueue[16]"):
#1  0x00007f19ad4eea76 in QBasicMutex::lockInternal() () at /usr/lib/libQt5Core.so.5
#2  0x00007f19ad4eec53 in QMutex::lock() () at /usr/lib/libQt5Core.so.5
#3  0x00007f19ad4f7188 in QReadWriteLock::tryLockForRead(int) () at /usr/lib/libQt5Core.so.5
#4  0x00007f19aeef5b0d in  () at /usr/lib/libQt5DBus.so.5
#5  0x00007f19aeeecfe9 in QDBusConnection::asyncCall(QDBusMessage const&, int) const () at /usr/lib/libQt5DBus.so.5
#6  0x00007f199d395220 in  () at /usr/lib/libKF5Runner.so.5
#7  0x00007f199d39ebd0 in  () at /usr/lib/libKF5Runner.so.5
#8  0x00007f199ff8b7de in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#9  0x00007f199ff8c726 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#10 0x00007f199ff90442 in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#11 0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#12 0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#13 0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 21 (Thread 0x7f1960ff96c0 (LWP 7327) "GlobalQueue[15]"):
#1  0x00007f19ace9c7a0 in pthread_cond_wait () at /usr/lib/libc.so.6
#2  0x00007f19ad4fae64 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/libQt5Core.so.5
#3  0x00007f199ff93e36 in ThreadWeaver::Weaver::takeFirstAvailableJobOrSuspendOrWait(ThreadWeaver::Thread*, bool, bool, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#4  0x00007f199ff9407f in  () at /usr/lib/libKF5ThreadWeaver.so.5
#5  0x00007f199ff92976 in ThreadWeaver::Weaver::applyForWork(ThreadWeaver::Thread*, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#6  0x00007f199ff9039e in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#7  0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#8  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#9  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 20 (Thread 0x7f19617fa6c0 (LWP 7326) "GlobalQueue[14]"):
#1  0x00007f19ace9c7a0 in pthread_cond_wait () at /usr/lib/libc.so.6
#2  0x00007f19ad4fae64 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/libQt5Core.so.5
#3  0x00007f199ff93e36 in ThreadWeaver::Weaver::takeFirstAvailableJobOrSuspendOrWait(ThreadWeaver::Thread*, bool, bool, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#4  0x00007f199ff9407f in  () at /usr/lib/libKF5ThreadWeaver.so.5
#5  0x00007f199ff92976 in ThreadWeaver::Weaver::applyForWork(ThreadWeaver::Thread*, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#6  0x00007f199ff9039e in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#7  0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#8  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#9  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 19 (Thread 0x7f1961ffb6c0 (LWP 7325) "GlobalQueue[13]"):
#1  0x00007f19ace9c7a0 in pthread_cond_wait () at /usr/lib/libc.so.6
#2  0x00007f19ad4fae64 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/libQt5Core.so.5
#3  0x00007f199ff93e36 in ThreadWeaver::Weaver::takeFirstAvailableJobOrSuspendOrWait(ThreadWeaver::Thread*, bool, bool, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#4  0x00007f199ff9407f in  () at /usr/lib/libKF5ThreadWeaver.so.5
#5  0x00007f199ff92976 in ThreadWeaver::Weaver::applyForWork(ThreadWeaver::Thread*, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#6  0x00007f199ff9039e in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#7  0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#8  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#9  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 18 (Thread 0x7f19627fc6c0 (LWP 7324) "GlobalQueue[12]"):
#1  0x00007f19ace9c7a0 in pthread_cond_wait () at /usr/lib/libc.so.6
#2  0x00007f19ad4fae64 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/libQt5Core.so.5
#3  0x00007f199ff93e36 in ThreadWeaver::Weaver::takeFirstAvailableJobOrSuspendOrWait(ThreadWeaver::Thread*, bool, bool, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#4  0x00007f199ff9407f in  () at /usr/lib/libKF5ThreadWeaver.so.5
#5  0x00007f199ff92976 in ThreadWeaver::Weaver::applyForWork(ThreadWeaver::Thread*, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#6  0x00007f199ff9039e in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#7  0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#8  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#9  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 17 (Thread 0x7f1962ffd6c0 (LWP 7323) "GlobalQueue[11]"):
#1  0x00007f19ad4eea76 in QBasicMutex::lockInternal() () at /usr/lib/libQt5Core.so.5
#2  0x00007f19ad4eec53 in QMutex::lock() () at /usr/lib/libQt5Core.so.5
#3  0x00007f19ad4f7188 in QReadWriteLock::tryLockForRead(int) () at /usr/lib/libQt5Core.so.5
#4  0x00007f19aeef5b0d in  () at /usr/lib/libQt5DBus.so.5
#5  0x00007f19aeeecfe9 in QDBusConnection::asyncCall(QDBusMessage const&, int) const () at /usr/lib/libQt5DBus.so.5
#6  0x00007f199d395220 in  () at /usr/lib/libKF5Runner.so.5
#7  0x00007f199d39ebd0 in  () at /usr/lib/libKF5Runner.so.5
#8  0x00007f199ff8b7de in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#9  0x00007f199ff8c726 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#10 0x00007f199ff90442 in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#11 0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#12 0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#13 0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 16 (Thread 0x7f19637fe6c0 (LWP 7322) "GlobalQueue[10]"):
#1  0x00007f19ace9c7a0 in pthread_cond_wait () at /usr/lib/libc.so.6
#2  0x00007f19ad4fae64 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/libQt5Core.so.5
#3  0x00007f199ff93e36 in ThreadWeaver::Weaver::takeFirstAvailableJobOrSuspendOrWait(ThreadWeaver::Thread*, bool, bool, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#4  0x00007f199ff9407f in  () at /usr/lib/libKF5ThreadWeaver.so.5
#5  0x00007f199ff92976 in ThreadWeaver::Weaver::applyForWork(ThreadWeaver::Thread*, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#6  0x00007f199ff9039e in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#7  0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#8  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#9  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 15 (Thread 0x7f1963fff6c0 (LWP 7321) "GlobalQueue[09]"):
#1  0x00007f19ad4eea76 in QBasicMutex::lockInternal() () at /usr/lib/libQt5Core.so.5
#2  0x00007f19ad4eec53 in QMutex::lock() () at /usr/lib/libQt5Core.so.5
#3  0x00007f19ad4f7188 in QReadWriteLock::tryLockForRead(int) () at /usr/lib/libQt5Core.so.5
#4  0x00007f19aeef5b0d in  () at /usr/lib/libQt5DBus.so.5
#5  0x00007f19aeeecfe9 in QDBusConnection::asyncCall(QDBusMessage const&, int) const () at /usr/lib/libQt5DBus.so.5
#6  0x00007f199d395220 in  () at /usr/lib/libKF5Runner.so.5
#7  0x00007f199d39ebd0 in  () at /usr/lib/libKF5Runner.so.5
#8  0x00007f199ff8b7de in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#9  0x00007f199ff8c726 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#10 0x00007f199ff90442 in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#11 0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#12 0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#13 0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 14 (Thread 0x7f1980ff96c0 (LWP 7320) "GlobalQueue[08]"):
#1  0x00007f19ace9c7a0 in pthread_cond_wait () at /usr/lib/libc.so.6
#2  0x00007f19ad4fae64 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/libQt5Core.so.5
#3  0x00007f199ff93e36 in ThreadWeaver::Weaver::takeFirstAvailableJobOrSuspendOrWait(ThreadWeaver::Thread*, bool, bool, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#4  0x00007f199ff9407f in  () at /usr/lib/libKF5ThreadWeaver.so.5
#5  0x00007f199ff92976 in ThreadWeaver::Weaver::applyForWork(ThreadWeaver::Thread*, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#6  0x00007f199ff9039e in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#7  0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#8  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#9  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 13 (Thread 0x7f19817fa6c0 (LWP 7319) "GlobalQueue[07]"):
#1  0x00007f19ace9c7a0 in pthread_cond_wait () at /usr/lib/libc.so.6
#2  0x00007f19ad4fae64 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/libQt5Core.so.5
#3  0x00007f199ff93e36 in ThreadWeaver::Weaver::takeFirstAvailableJobOrSuspendOrWait(ThreadWeaver::Thread*, bool, bool, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#4  0x00007f199ff9407f in  () at /usr/lib/libKF5ThreadWeaver.so.5
#5  0x00007f199ff92976 in ThreadWeaver::Weaver::applyForWork(ThreadWeaver::Thread*, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#6  0x00007f199ff9039e in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#7  0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#8  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#9  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 12 (Thread 0x7f1981ffb6c0 (LWP 7318) "GlobalQueue[06]"):
#1  0x00007f19ad4eea76 in QBasicMutex::lockInternal() () at /usr/lib/libQt5Core.so.5
#2  0x00007f19ad4eec53 in QMutex::lock() () at /usr/lib/libQt5Core.so.5
#3  0x00007f19ad4f7188 in QReadWriteLock::tryLockForRead(int) () at /usr/lib/libQt5Core.so.5
#4  0x00007f19aeef5b0d in  () at /usr/lib/libQt5DBus.so.5
#5  0x00007f19aeeecfe9 in QDBusConnection::asyncCall(QDBusMessage const&, int) const () at /usr/lib/libQt5DBus.so.5
#6  0x00007f199d395220 in  () at /usr/lib/libKF5Runner.so.5
#7  0x00007f199d39ebd0 in  () at /usr/lib/libKF5Runner.so.5
#8  0x00007f199ff8b7de in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#9  0x00007f199ff8c726 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#10 0x00007f199ff90442 in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#11 0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#12 0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#13 0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 11 (Thread 0x7f19827fc6c0 (LWP 7317) "GlobalQueue[05]"):
#1  0x00007f19ace9c7a0 in pthread_cond_wait () at /usr/lib/libc.so.6
#2  0x00007f19ad4fae64 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/libQt5Core.so.5
#3  0x00007f199ff93e36 in ThreadWeaver::Weaver::takeFirstAvailableJobOrSuspendOrWait(ThreadWeaver::Thread*, bool, bool, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#4  0x00007f199ff9407f in  () at /usr/lib/libKF5ThreadWeaver.so.5
#5  0x00007f199ff92976 in ThreadWeaver::Weaver::applyForWork(ThreadWeaver::Thread*, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#6  0x00007f199ff9039e in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#7  0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#8  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#9  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 10 (Thread 0x7f1982ffd6c0 (LWP 7316) "GlobalQueue[04]"):
#1  0x00007f19ace9c7a0 in pthread_cond_wait () at /usr/lib/libc.so.6
#2  0x00007f19ad4fae64 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/libQt5Core.so.5
#3  0x00007f199ff93e36 in ThreadWeaver::Weaver::takeFirstAvailableJobOrSuspendOrWait(ThreadWeaver::Thread*, bool, bool, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#4  0x00007f199ff9407f in  () at /usr/lib/libKF5ThreadWeaver.so.5
#5  0x00007f199ff92976 in ThreadWeaver::Weaver::applyForWork(ThreadWeaver::Thread*, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#6  0x00007f199ff9039e in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#7  0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#8  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#9  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 9 (Thread 0x7f19837fe6c0 (LWP 7315) "GlobalQueue[03]"):
#1  0x00007f19ad4eea76 in QBasicMutex::lockInternal() () at /usr/lib/libQt5Core.so.5
#2  0x00007f19ad4eec53 in QMutex::lock() () at /usr/lib/libQt5Core.so.5
#3  0x00007f19ad4f7188 in QReadWriteLock::tryLockForRead(int) () at /usr/lib/libQt5Core.so.5
#4  0x00007f19aeef5b0d in  () at /usr/lib/libQt5DBus.so.5
#5  0x00007f19aeeecfe9 in QDBusConnection::asyncCall(QDBusMessage const&, int) const () at /usr/lib/libQt5DBus.so.5
#6  0x00007f199d395220 in  () at /usr/lib/libKF5Runner.so.5
#7  0x00007f199d39ebd0 in  () at /usr/lib/libKF5Runner.so.5
#8  0x00007f199ff8b7de in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#9  0x00007f199ff8c726 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#10 0x00007f199ff90442 in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#11 0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#12 0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#13 0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 8 (Thread 0x7f1983fff6c0 (LWP 7314) "GlobalQueue[02]"):
#1  0x00007f19ace9c7a0 in pthread_cond_wait () at /usr/lib/libc.so.6
#2  0x00007f19ad4fae64 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/libQt5Core.so.5
#3  0x00007f199ff93e36 in ThreadWeaver::Weaver::takeFirstAvailableJobOrSuspendOrWait(ThreadWeaver::Thread*, bool, bool, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#4  0x00007f199ff9407f in  () at /usr/lib/libKF5ThreadWeaver.so.5
#5  0x00007f199ff92976 in ThreadWeaver::Weaver::applyForWork(ThreadWeaver::Thread*, bool) () at /usr/lib/libKF5ThreadWeaver.so.5
#6  0x00007f199ff9039e in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#7  0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#8  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#9  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 7 (Thread 0x7f19908ba6c0 (LWP 7313) "GlobalQueue[01]"):
#1  0x00007f19ad4eea76 in QBasicMutex::lockInternal() () at /usr/lib/libQt5Core.so.5
#2  0x00007f19ad4eec53 in QMutex::lock() () at /usr/lib/libQt5Core.so.5
#3  0x00007f19ad4f7188 in QReadWriteLock::tryLockForRead(int) () at /usr/lib/libQt5Core.so.5
#4  0x00007f19aeef5b0d in  () at /usr/lib/libQt5DBus.so.5
#5  0x00007f19aeeecfe9 in QDBusConnection::asyncCall(QDBusMessage const&, int) const () at /usr/lib/libQt5DBus.so.5
#6  0x00007f199d395220 in  () at /usr/lib/libKF5Runner.so.5
#7  0x00007f199d39ebd0 in  () at /usr/lib/libKF5Runner.so.5
#8  0x00007f199ff8b7de in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#9  0x00007f199ff8c726 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#10 0x00007f199ff90442 in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#11 0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#12 0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#13 0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 6 (Thread 0x7f19921fe6c0 (LWP 7306) "krunner"):
#1  0x00007f19a8a736f9 in  () at /usr/lib/libusbmuxd-2.0.so.6
#2  0x00007f19a8a743cc in  () at /usr/lib/libusbmuxd-2.0.so.6
#3  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#4  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 5 (Thread 0x7f1992dff6c0 (LWP 7303) "CPMMListener"):
#1  0x00007f199e978a6e in  () at /usr/lib/libnvidia-glcore.so.530.41.03
#2  0x00007f199e97ba08 in  () at /usr/lib/libnvidia-glcore.so.530.41.03
#3  0x00007f199e913988 in  () at /usr/lib/libnvidia-glcore.so.530.41.03
#4  0x00007f199e913d5a in  () at /usr/lib/libnvidia-glcore.so.530.41.03
#5  0x00007f199e91162a in  () at /usr/lib/libnvidia-glcore.so.530.41.03
#6  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#7  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 4 (Thread 0x7f199cbff6c0 (LWP 7302) "QSGRenderThread"):
#1  0x00007f19ace9c7a0 in pthread_cond_wait () at /usr/lib/libc.so.6
#2  0x00007f19ad4fae64 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () at /usr/lib/libQt5Core.so.5
#3  0x00007f19af1fcfc2 in  () at /usr/lib/libQt5Quick.so.5
#4  0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#5  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#6  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 3 (Thread 0x7f19a53ff6c0 (LWP 7301) "QQmlThread"):
#1  0x00007f19abd6c17f in  () at /usr/lib/libglib-2.0.so.0
#2  0x00007f19abd0e1a2 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#3  0x00007f19ad6e9f2f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#4  0x00007f19ad699824 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#5  0x00007f19ad4f6eb6 in QThread::exec() () at /usr/lib/libQt5Core.so.5
#6  0x00007f19aecc2410 in  () at /usr/lib/libQt5Qml.so.5
#7  0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#8  0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#9  0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 2 (Thread 0x7f19a801e6c0 (LWP 7299) "QDBusConnection"):
#1  0x00007f19ad4eea76 in QBasicMutex::lockInternal() () at /usr/lib/libQt5Core.so.5
#2  0x00007f19ad4eec53 in QMutex::lock() () at /usr/lib/libQt5Core.so.5
#3  0x00007f19ad4f210b in QReadWriteLock::unlock() () at /usr/lib/libQt5Core.so.5
#4  0x00007f19aeef73ba in  () at /usr/lib/libQt5DBus.so.5
#5  0x00007f19aeeeee91 in  () at /usr/lib/libQt5DBus.so.5
#6  0x00007f19ad6c2834 in QObject::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#7  0x00007f19ad69aafc in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#8  0x00007f19ad69fa7b in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/libQt5Core.so.5
#9  0x00007f19ad6e6088 in  () at /usr/lib/libQt5Core.so.5
#10 0x00007f19abd0f53b in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#11 0x00007f19abd6c219 in  () at /usr/lib/libglib-2.0.so.0
#12 0x00007f19abd0e1a2 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#13 0x00007f19ad6e9f0c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#14 0x00007f19ad699824 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#15 0x00007f19ad4f6eb6 in QThread::exec() () at /usr/lib/libQt5Core.so.5
#16 0x00007f19aeeee69a in  () at /usr/lib/libQt5DBus.so.5
#17 0x00007f19ad4f30da in  () at /usr/lib/libQt5Core.so.5
#18 0x00007f19ace9d44b in  () at /usr/lib/libc.so.6
#19 0x00007f19acf20e40 in  () at /usr/lib/libc.so.6

Thread 1 (Thread 0x7f19a8525500 (LWP 7298) "krunner"):
#1  0x00007f19ad4ef47c in QSemaphore::acquire(int) () at /usr/lib/libQt5Core.so.5
#2  0x00007f19ad6d00f6 in  () at /usr/lib/libQt5Core.so.5
#3  0x00007f19ad6d03e4 in QObject::destroyed(QObject*) () at /usr/lib/libQt5Core.so.5
#4  0x00007f19ad6c651c in QObject::~QObject() () at /usr/lib/libQt5Core.so.5
#5  0x00007f19911ec5cc in  () at /usr/lib/qt/plugins/kf5/urifilters/kuriikwsfilter.so
#6  0x00007f19acd64a4e in KUriFilter::~KUriFilter() () at /usr/lib/libKF5KIOWidgets.so.5
#7  0x00007f19acd64b5e in  () at /usr/lib/libKF5KIOWidgets.so.5
#8  0x00007f19ace52066 in  () at /usr/lib/libc.so.6
#9  0x00007f19ace521b0 in  () at /usr/lib/libc.so.6
#10 0x00007f19a80c6066 in  () at /usr/lib/libQt5XcbQpa.so.5
#11 0x00007f19a80f5708 in  () at /usr/lib/libQt5XcbQpa.so.5
#12 0x00007f19abd0f53b in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#13 0x00007f19abd6c219 in  () at /usr/lib/libglib-2.0.so.0
#14 0x00007f19abd0e1a2 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#15 0x00007f19ad6e9f0c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#16 0x00007f19ad699824 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#17 0x00007f19ad69acc3 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#18 0x0000560f969f908b in  ()
#19 0x00007f19ace39850 in  () at /usr/lib/libc.so.6
#20 0x00007f19ace3990a in __libc_start_main () at /usr/lib/libc.so.6
#21 0x0000560f969f9285 in  ()
[Inferior 1 (process 7298) detached]

Reported using DrKonqi
Comment 1 Nate Graham 2023-05-24 17:22:01 UTC
Crashing in libqalculate... I wonder if there's anything we can do here on the KRunner side.
Comment 2 Fushan Wen 2023-06-07 14:06:58 UTC
Git commit 9d18e0821455366c00a763252515d48741316f6c by Fushan Wen, on behalf of Max Ramanouski.
Committed on 07/06/2023 at 14:06.
Pushed by fusionfuture into branch 'Plasma/5.27'.

runners/calculator: implement thread-safety in QalculateEngine::evaluate

Libqalculate does not seem to support ability to run multiple computations
that are controlled or have timeout set beeing run in the same time.
After the timeout was introduced in QalculateEngine this led to BUG 470219,
which happens when computations are started from multiple threads in the same time
that "confuses" libqalculate computation thread which leads to crash in libqalculate code.

To fix that we need to ensure that only one evaluation is running at single moment of time.
This is done via QalculateLock class that is like QMutexLocker but for libqalculate.
QalculateLock is implemented with two static mutexes. Mutex s_evalLock is used
to ensure that only one evaluation is running at single moment.
Mutex s_ctrlLock is used to ensure that thread that aborted evaluation will
get to start next evaluation.

M  +35   -8    runners/calculator/qalculate_engine.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/9d18e0821455366c00a763252515d48741316f6c
Comment 3 Fushan Wen 2023-06-07 14:20:40 UTC
*** Bug 470312 has been marked as a duplicate of this bug. ***
Comment 4 Fushan Wen 2023-06-07 14:54:43 UTC
Git commit e2ef967c5860543c7c4bf3da9129b0c70292e8ed by Fushan Wen, on behalf of Max Ramanouski.
Committed on 07/06/2023 at 14:07.
Pushed by fusionfuture into branch 'master'.

runners/calculator: implement thread-safety in QalculateEngine::evaluate

Libqalculate does not seem to support ability to run multiple computations
that are controlled or have timeout set beeing run in the same time.
After the timeout was introduced in QalculateEngine this led to BUG 470219,
which happens when computations are started from multiple threads in the same time
that "confuses" libqalculate computation thread which leads to crash in libqalculate code.

To fix that we need to ensure that only one evaluation is running at single moment of time.
This is done via QalculateLock class that is like QMutexLocker but for libqalculate.
QalculateLock is implemented with two static mutexes. Mutex s_evalLock is used
to ensure that only one evaluation is running at single moment.
Mutex s_ctrlLock is used to ensure that thread that aborted evaluation will
get to start next evaluation.


(cherry picked from commit 9d18e0821455366c00a763252515d48741316f6c)

M  +35   -8    runners/calculator/qalculate_engine.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/e2ef967c5860543c7c4bf3da9129b0c70292e8ed
Comment 5 Fushan Wen 2023-06-26 10:55:41 UTC
*** Bug 471376 has been marked as a duplicate of this bug. ***
Comment 6 Fushan Wen 2023-07-20 16:30:19 UTC
*** Bug 472415 has been marked as a duplicate of this bug. ***
Comment 7 Nate Graham 2023-08-13 20:03:03 UTC
*** Bug 473339 has been marked as a duplicate of this bug. ***
Comment 8 Fushan Wen 2023-08-18 14:17:59 UTC
*** Bug 473331 has been marked as a duplicate of this bug. ***