Bug 511233 - Services runner crashes calling app in Bitap::bitap() in distros that use Musl rather than GLibc (like PostmarketOS)
Summary: Services runner crashes calling app in Bitap::bitap() in distros that use Mus...
Status: RESOLVED FIXED
Alias: None
Product: krunner
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 6.5.0
Platform: postmarketOS Linux
: HI crash
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: regression
: 511286 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-10-27 18:24 UTC by Bart Ribbers
Modified: 2025-11-13 05:58 UTC (History)
9 users (show)

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


Attachments
gdb backtrace of plasma-workspace crashing (10.32 KB, text/plain)
2025-10-27 18:24 UTC, Bart Ribbers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bart Ribbers 2025-10-27 18:24:25 UTC
Created attachment 186240 [details]
gdb backtrace of plasma-workspace crashing

SUMMARY
Since the 6.5.0 update plasmashell has been crashing the moment I try to search for anything using krunner (either directly with Alt + Space or through the Kickoff search field). The backtrace suggests something in https://invent.kde.org/plasma/plasma-workspace/-/blob/master/runners/services/bitap.h?ref_type=heads#L38 is causing it but I fail to find the exact cause.

If I just use krunner directly only krunner itself crashes and the shell remains alive.

STEPS TO REPRODUCE
1. On a Plasma 6.5.0 system, open Kickoff
2. Type anything to search
3. Crash

OBSERVED RESULT
It should not crash the shell.

EXPECTED RESULT
The shell crashes instantly and has to recover itself.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: postmarketOS
KDE Plasma Version: 6.5.0
KDE Frameworks Version: 6.19.0
Qt Version: 6.9.3
Comment 1 Nate Graham 2025-10-27 20:27:15 UTC
Could be a Musl vs Glibc thing, maybe?


Thread 35 "krunner_service" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 29480]
0x00007fffddf89e19 in Bitap::bitap (name=..., pattern=..., hammingDistance=hammingDistance@entry=1) at /home/pmos/build/src/plasma-workspace-6.5.0/runners/services/bitap.h:39
warning: 39	/home/pmos/build/src/plasma-workspace-6.5.0/runners/services/bitap.h: No such file or directory
#0  0x00007fffddf89e19 in Bitap::bitap (name=..., pattern=..., hammingDistance=hammingDistance@entry=1) at /home/pmos/build/src/plasma-workspace-6.5.0/runners/services/bitap.h:39
        maxMaskBits = <optimized out>
        patternMask = <error reading variable patternMask (value of type `PatternMask' requires 524280 bytes, which is more than max-value-size)>
        match = <optimized out>
        bits = <optimized out>
        transpositions = <optimized out>
#1  0x00007fffddf8b52e in (anonymous namespace)::makeScores<QString, QList<QStringView> > (notNormalizedString=..., queryList=...) at /home/pmos/build/src/plasma-workspace-6.5.0/runners/services/servicerunner.cpp:97
        maxDistance = 1
        bitapScore = <optimized out>
        levenshtein = <optimized out>
        bitap = {<std::_Optional_base<Bitap::Match, true, true>> = {_M_payload = {<std::_Optional_payload_base<Bitap::Match>> = {_M_payload = {_M_empty = {<No data fields>}, _M_value = {size = 0, distance = 140736917132656}}, _M_engaged = 184}, <No data fields>}}, <std::_Enable_copy_move<true, true, true, true, std::optional<Bitap::Match> >> = {<No data fields>}, <No data fields>}
        noSubstitionBonus = <optimized out>
        completeMatchBonus = <optimized out>
        startsWithBonus = <optimized out>
        queryItem = @0x7fffd6b6e9c0: {m_size = 1, m_data = 0x7fffdd590ff8 u"a"}
        __for_range = @0x7fffddf3d508: {<QListSpecialMethods<QStringView>> = {<QListSpecialMethodsBase<QStringView>> = {<No data fields>}, <No data fields>}, d = {d = 0x7fffd6b6e9b0, ptr = 0x7fffd6b6e9c0, size = 1}}
        __for_begin = <optimized out>
        __for_end = <optimized out>
        string = {d = {d = 0x7fffd6b678f0, ptr = 0x7fffd6b67900 u"emoji selector", size = 14}, static _empty = 0 u'\000'}
        cards = {<std::_Vector_base<(anonymous namespace)::ScoreCard, std::allocator<(anonymous namespace)::ScoreCard> >> = {_M_impl = {<std::allocator<(anonymous namespace)::ScoreCard>> = {<std::__new_allocator<(anonymous namespace)::ScoreCard>> = {<No data fields>}, <No data fields>}, <std::_Vector_base<(anonymous namespace)::ScoreCard, std::allocator<(anonymous namespace)::ScoreCard> >::_Vector_impl_data> = {_M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0}, <No data fields>}}, <No data fields>}
#2  0x00007fffddf8ef9b in ServiceFinder::fuzzyScore (this=0x7fffddf3d4b0, service=...) at /home/pmos/build/src/plasma-workspace-6.5.0/runners/services/servicerunner.cpp:321
        name = {d = {d = 0x7fffd9ef29a0, ptr = 0x7fffd9ef29b0 u"Emoji Selector", size = 14}, static _empty = 0 u'\000'}
        weightedCards = {_M_elems = {{cards = {<std::_Vector_base<(anonymous namespace)::ScoreCard, std::allocator<(anonymous namespace)::ScoreCard> >> = {_M_impl = {<std::allocator<(anonymous namespace)::ScoreCard>> = {<std::__new_allocator<(anonymous namespace)::ScoreCard>> = {<No data fields>}, <No data fields>}, <std::_Vector_base<(anonymous namespace)::ScoreCard, std::allocator<(anonymous namespace)::ScoreCard> >::_Vector_impl_data> = {_M_start = 0x7fffdd590ff8, _M_finish = 0x7fffddf3d420, _M_end_of_storage = 0x1}, <No data fields>}}, <No data fields>}, weight = 6.9533469246206595e-310}, {cards = {<std::_Vector_base<(anonymous namespace)::ScoreCard, std::allocator<(anonymous namespace)::ScoreCard> >> = {_M_impl = {<std::allocator<(anonymous namespace)::ScoreCard>> = {<std::__new_allocator<(anonymous namespace)::ScoreCard>> = {<No data fields>}, <No data fields>}, <std::_Vector_base<(anonymous namespace)::ScoreCard, std::allocator<(anonymous namespace)::ScoreCard> >::_Vector_impl_data> = {_M_start = 0x0, _M_finish = 0x100000000, _M_end_of_storage = 0x7fffdf9bb8c0}, <No data fields>}}, <No data fields>}, weight = 6.5936597542731832e+115}, {cards = {<std::_Vector_base<(anonymous namespace)::ScoreCard, std::allocator<(anonymous namespace)::ScoreCard> >> = {_M_impl = {<std::allocator<(anonymous namespace)::ScoreCard>> = {<std::__new_allocator<(anonymous namespace)::ScoreCard>> = {<No data fields>}, <No data fields>}, <std::_Vector_base<(anonymous namespace)::ScoreCard, std::allocator<(anonymous namespace)::ScoreCard> >::_Vector_impl_data> = {_M_start = 0x7fffddf3d420, _M_finish = 0x7ffff7f9e25a <__libc_free+24>, _M_end_of_storage = 0x7fffdf752390}, <No data fields>}}, <No data fields>}, weight = 6.953346924663248e-310}, {cards = {<std::_Vector_base<(anonymous namespace)::ScoreCard, std::allocator<(anonymous namespace)::ScoreCard> >> = {_M_impl = {<std::allocator<(anonymous namespace)::ScoreCard>> = {<std::__new_allocator<(anonymous namespace)::ScoreCard>> = {<No data fields>}, <No data fields>}, <std::_Vector_base<(anonymous namespace)::ScoreCard, std::allocator<(anonymous namespace)::ScoreCard> >::_Vector_impl_data> = {_M_start = 0x7fffdd590ff8, _M_finish = 0x7fffdf9bb8d4, _M_end_of_storage = 0x0}, <No data fields>}}, <No data fields>}, weight = 6.9533478095953921e-310}}}
        scores = <optimized out>
        finalScore = <optimized out>
#3  ServiceFinder::matchNameKeywordAndGenericName (this=this@entry=0x7fffddf3d4b0) at /home/pmos/build/src/plasma-workspace-6.5.0/runners/services/servicerunner.cpp:366
        match = {d = {d = {ptr = 0x7fffdd4b0560}}}
        score = <optimized out>
        service = @0x7fffdcb24770: {d = {ptr = 0x7fffda36d670}}
        __for_range = @0x7fffddf3d4c0: {<QListSpecialMethods<QExplicitlySharedDataPointer<KService> >> = {<QListSpecialMethodsBase<QExplicitlySharedDataPointer<KService> >> = {<No data fields>}, <No data fields>}, d = {d = 0x7fffdcb24760, ptr = 0x7fffdcb24770, size = 41}}
        __for_begin = <optimized out>
        __for_end = <optimized out>
        isTest = false
#4  0x00007fffddf88e65 in ServiceFinder::match (this=0x7fffddf3d4b0, context=...) at /home/pmos/build/src/plasma-workspace-6.5.0/runners/services/servicerunner.cpp:201
No locals.
#5  ServiceRunner::match (this=<optimized out>, context=...) at /home/pmos/build/src/plasma-workspace-6.5.0/runners/services/servicerunner.cpp:518
        finder = {m_runner = 0x7fffddf7b8d0, m_seen = {q_hash = {d = 0x0}}, m_services = {<QListSpecialMethods<QExplicitlySharedDataPointer<KService> >> = {<QListSpecialMethodsBase<QExplicitlySharedDataPointer<KService> >> = {<No data fields>}, <No data fields>}, d = {d = 0x7fffdcb24760, ptr = 0x7fffdcb24770, size = 41}}, matches = {<QListSpecialMethods<KRunner::QueryMatch>> = {<QListSpecialMethodsBase<KRunner::QueryMatch>> = {<No data fields>}, <No data fields>}, d = {d = 0x0, ptr = 0x0, size = 0}}, query = {d = {d = 0x7fffdd590fe0, ptr = 0x7fffdd590ff8 u"a", size = 1}, static _empty = 0 u'\000'}, queryList = {<QListSpecialMethods<QStringView>> = {<QListSpecialMethodsBase<QStringView>> = {<No data fields>}, <No data fields>}, d = {d = 0x7fffd6b6e9b0, ptr = 0x7fffd6b6e9c0, size = 1}}, weightedTermLength = 1}
#6  0x00007ffff7e3e2ce in KRunner::AbstractRunner::matchInternal (this=this@entry=0x7fffddf7b8d0, context=...) at /tmp/src/krunner-6.19.0/src/abstractrunner.cpp:175
No locals.
#7  0x00007ffff7e3e463 in KRunner::AbstractRunner::qt_static_metacall (_o=0x7fffddf7b8d0, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /tmp/src/krunner-6.19.0/build/src/KF6Runner_autogen/include/moc_abstractrunner.cpp:98
        _t = 0x7fffddf7b8d0
Comment 2 Nicolas Fella 2025-10-28 21:42:15 UTC
*** Bug 511286 has been marked as a duplicate of this bug. ***
Comment 3 Ellie 2025-10-29 00:41:54 UTC
For what it's worth, on musl distros this issue is potentially rather high impact. A first user running into this will probably not use KDE again in the near future.
Comment 4 Ellie 2025-10-31 21:54:11 UTC
For some reason, using 6.5.1 it's currently not crashing for me. Has anybody else seen a change? This has only been going on since today, so I'm not sure if it's permanently working now or what...
Comment 5 Nate Graham 2025-10-31 22:04:34 UTC
.
Comment 6 Ellie 2025-11-01 16:32:03 UTC
Can confirm even after running for multiple days and after rebooting, I haven't seen this crash happen anymore. It seems at least for me some update fixed this, intentionally or not.

Perhaps somebody else subscribed to this tickt can confirm.
Comment 7 Bart Ribbers 2025-11-01 16:37:38 UTC
That's only because I applied a workaround in the Alpine packaging by returning early in the broken function to prevent the crash. It does break fuzzy search so not great at all, but anything is better than crashing.

See the downstream issue, https://gitlab.alpinelinux.org/alpine/aports/-/issues/17653, and the workaround I applied https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/92351.

This still needs a proper fix.
Comment 8 Bug Janitor Service 2025-11-09 21:51:59 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5990
Comment 9 Harald Sitter 2025-11-10 18:25:06 UTC
Git commit 6bb87ff30e4bf00bb3086ee0657af0145810f2de by Harald Sitter, on behalf of John Zimmermann.
Committed on 10/11/2025 at 18:24.
Pushed by sitter into branch 'master'.

bitap: allocate patternMask on heap instead of stack

the current code results in a stackoverflow on systems
with smaller default stack size than glibc (e.g. musl)

M  +9    -7    runners/services/bitap.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/6bb87ff30e4bf00bb3086ee0657af0145810f2de
Comment 10 Harald Sitter 2025-11-10 18:27:02 UTC
Git commit d7a6a53e082197d19d172799d5f646b51fa22eab by Harald Sitter.
Committed on 10/11/2025 at 18:25.
Pushed by sitter into branch 'Plasma/6.5'.

bitap: allocate patternMask on heap instead of stack

the current code results in a stackoverflow on systems
with smaller default stack size than glibc (e.g. musl)


(cherry picked from commit 6bb87ff30e4bf00bb3086ee0657af0145810f2de)

Co-authored-by: John Zimmermann <me@johnnynator.dev>

M  +9    -7    runners/services/bitap.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/d7a6a53e082197d19d172799d5f646b51fa22eab