Bug 450809

Summary: Segfault when searching app in kickoff
Product: [Plasma] plasmashell Reporter: Tobias Fella <fella>
Component: Application Launcher (Kickoff)Assignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: crash CC: a.samirh78, bugseforuns, guimarcalsilva, isma.af, mikel5764, nate, nicolas.fella, noahadvs, postix
Priority: NOR Keywords: regression
Version: master   
Target Milestone: 1.0   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Tobias Fella 2022-02-24 16:42:14 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Open kickoff
2. search something
3. Profit

OBSERVED RESULT
Crash

EXPECTED RESULT
No Crash

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: master
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: master
Qt Version: 

ADDITIONAL INFORMATION

Seems to be caused by https://invent.kde.org/frameworks/kio/-/merge_requests/751/diffs?commit_id=4c4f4b919a81706913596e7ba518165dd80c9eb7

The relevant value for execlist is "MOZ_USE_WAYLAND=1 /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=thunderbird --file-forwarding org.mozilla.Thunderbird @@u %u @@"

backtrace:
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007f2de634f8f3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007f2de63026a6 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007f2de62ec7d3 in __GI_abort () at abort.c:79
#4  0x00007f2de689344b in qt_message_fatalPython Exception <class 'gdb.error'>: value has been optimized out
 (message=<synthetic pointer>, context=...) at global/qlogging.cpp:1914
#5  QMessageLogger::fatal(char const*, ...) const (this=this@entry=0x7f2cdad17e88, msg=msg@entry=0x7f2de6b52028 "ASSERT failure in %s: \"%s\", file %s, line %d") at global/qlogging.cpp:893
#6  0x00007f2de68928ae in qt_assert_x(char const*, char const*, char const*, int) (where=<optimized out>, what=<optimized out>, file=<optimized out>, line=<optimized out>) at global/qglobal.cpp:3366
#7  0x00007f2de9227890 in QList<QString>::operator[](int) (this=0x7f2cdad17f70, i=0) at /usr/include/qt5/QtCore/qlist.h:579
#8  0x00007f2de922494a in KIO::DesktopExecParser::resultingArguments() const (this=0x7f2cdad18680) at /home/tobias/kde/src/kio/src/core/desktopexecparser.cpp:520
#9  0x00007f2cdb6a5153 in ServiceFinder::setupMatch(QExplicitlySharedDataPointer<KService> const&, Plasma::QueryMatch&) (this=0x7f2cdad18990, service=..., match=...)
    at /home/tobias/kde/src/plasma-workspace/runners/services/servicerunner.cpp:175
#10 0x00007f2cdb6a5e2a in ServiceFinder::matchNameKeywordAndGenericName() (this=0x7f2cdad18990) at /home/tobias/kde/src/plasma-workspace/runners/services/servicerunner.cpp:244
#11 0x00007f2cdb6a3f91 in ServiceFinder::match(Plasma::RunnerContext&) (this=0x7f2cdad18990, context=...) at /home/tobias/kde/src/plasma-workspace/runners/services/servicerunner.cpp:67
#12 0x00007f2cdb6a2784 in ServiceRunner::match(Plasma::RunnerContext&) (this=0x45d17a0, context=...) at /home/tobias/kde/src/plasma-workspace/runners/services/servicerunner.cpp:416
#13 0x00007f2d340a610a in Plasma::FindMatchesJob::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) (this=0x32761c0, self={...}) at /home/tobias/kde/src/krunner/src/runnerjobs.cpp:140
#14 0x00007f2d2c035822 in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) (this=0x7f2d2c057370 <ThreadWeaver::Private::defaultExecutor>, job={...}, thread=0x4bb0230)
    at /home/tobias/kde/src/threadweaver/src/executor.cpp:33
#15 0x00007f2d2c038287 in ThreadWeaver::Private::DefaultExecutor::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*)
    (this=0x7f2d2c057370 <ThreadWeaver::Private::defaultExecutor>, job={...}, thread=0x4bb0230) at /home/tobias/kde/src/threadweaver/src/job_p.cpp:49
#16 0x00007f2d2c0354ce in ThreadWeaver::ExecuteWrapper::executeWrapped(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) (this=0x4bb0808, job={...}, thread=0x4bb0230)
    at /home/tobias/kde/src/threadweaver/src/executewrapper.cpp:44
#17 0x00007f2d2c0381f2 in ThreadWeaver::Private::DebugExecuteWrapper::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) (this=0x4bb0808, job={...}, th=0x4bb0230)
    at /home/tobias/kde/src/threadweaver/src/job_p.cpp:38
#18 0x00007f2d2c03686e in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) (this=0x32761d0, self={...}, th=0x4bb0230) at /home/tobias/kde/src/threadweaver/src/job.cpp:64
#19 0x00007f2d2c03bf33 in ThreadWeaver::Thread::run() (this=0x4bb0230) at /home/tobias/kde/src/threadweaver/src/thread.cpp:98
#20 0x00007f2de68cb4c6 in QThreadPrivate::start(void*) (arg=0x4bb0230) at thread/qthread_unix.cpp:329
#21 0x00007f2de634db1a in start_thread (arg=<optimized out>) at pthread_create.c:443
#22 0x00007f2de63d2650 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
Comment 1 Bug Janitor Service 2022-02-26 11:18:17 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/773
Comment 2 postix 2022-02-27 15:32:52 UTC
*** Bug 450876 has been marked as a duplicate of this bug. ***
Comment 3 postix 2022-02-27 15:33:04 UTC
*** Bug 450900 has been marked as a duplicate of this bug. ***
Comment 4 Ahmad Samir 2022-02-27 15:56:25 UTC
I reverted the commit in KIO; AFAICS, the cause of the crash is using an out-of-bounds index into a QStringList, which is a side effect of [1] as the executableName var isn't empty when env vars are parsed.

So, reverted (to stem off the crash reports :|), till we hear what dfaure has to say about parsing env vars on Exec= line [2]

[1] https://invent.kde.org/frameworks/kio/-/merge_requests/751/diffs?commit_id=4c4f4b919a81706913596e7ba518165dd80c9eb7
[2] https://bugs.kde.org/show_bug.cgi?id=448859#c3