Summary: | krunner sometimes crashes in MathStructure::setAborted() after typing a few numbers/letters | ||
---|---|---|---|
Product: | [Plasma] krunner | Reporter: | Sean <kde> |
Component: | general | Assignee: | 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: | https://invent.kde.org/plasma/plasma-workspace/-/commit/e2ef967c5860543c7c4bf3da9129b0c70292e8ed | Version Fixed In: | 5.27.6 |
Sentry Crash Report: |
Description
Sean
2023-05-24 15:38:46 UTC
Crashing in libqalculate... I wonder if there's anything we can do here on the KRunner side. 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 *** Bug 470312 has been marked as a duplicate of this bug. *** 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 *** Bug 471376 has been marked as a duplicate of this bug. *** *** Bug 472415 has been marked as a duplicate of this bug. *** *** Bug 473339 has been marked as a duplicate of this bug. *** *** Bug 473331 has been marked as a duplicate of this bug. *** |