Bug 477149 - krunner crashes when searching
Summary: krunner crashes when searching
Status: RESOLVED FIXED
Alias: None
Product: krunner
Classification: Plasma
Component: general (show other bugs)
Version: 5.27.80
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2023-11-17 16:14 UTC by Patrick Silva
Modified: 2025-03-27 15:44 UTC (History)
4 users (show)

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


Attachments
long backtrace (92.87 KB, text/plain)
2023-11-17 16:14 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2023-11-17 16:14:50 UTC
Created attachment 163246 [details]
long backtrace

SUMMARY
Sometimes krunner crashes when searching.

Operating System: Arch Linux 
KDE Plasma Version: 5.27.80
KDE Frameworks Version: 5.245.0
Qt Version: 6.6.0
Graphics Platform: Wayland
Comment 1 Alexander Lohnau 2023-11-17 16:45:42 UTC
            // Check whether we got an item representing a non-existent file,
            // if so, schedule its removal from the database
            // we want to do this async so that we don't block
            std::thread([=, this] {
                QList<QString> missingResources;
                for (const auto &item : newItems) {
                    // QFile.exists() can be incredibly slow (eg. if resource is on remote filesystem)
                    if (item.resource().startsWith(QLatin1Char('/')) && !QFile(item.resource()).exists()) {
                        missingResources << item.resource();
                    }
                }

                if (missingResources.empty()) {
                    return;
                }

                QTimer::singleShot(0, this->d->q, [=, this] {
                    d->q->forgetResources(missingResources);
                });
            }).detach();

This code seems related and dangerous. I wonder if it may crash if the model is deleted and during/after that the code in the thread is run.
Comment 2 Alexander Lohnau 2023-11-17 20:20:55 UTC
We probably never had this issue in KF5, because the models were never cleaned up :D
Comment 3 Nicolas Fella 2024-01-27 22:57:06 UTC
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007fdd412ac8a3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007fdd4125c668 in __GI_raise (sig=6) at ../sysdeps/posix/raise.c:26
#3  0x00007fdd43f35960 in KCrash::defaultCrashHandler(int) (sig=6) at /usr/src/debug/kcrash/kcrash-5.245.0/src/kcrash.cpp:612
#4  0x00007fdd4125c710 in <signal handler called> () at /usr/lib/libc.so.6
#5  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#6  0x00007fdd412ac8a3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#7  0x00007fdd4125c668 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#8  0x00007fdd412444b8 in __GI_abort () at abort.c:79
#9  0x00007fdd382a28df in _crocus_batch_flush() () at ../mesa-23.2.1/src/gallium/drivers/crocus/crocus_batch.c:1024
#10 0x00007fdd3941ea10 in crocus_transfer_map() () at ../mesa-23.2.1/src/gallium/drivers/crocus/crocus_resource.c:1723
#11 0x00007fdd38daa827 in u_default_texture_subdata() () at ../mesa-23.2.1/src/gallium/auxiliary/util/u_transfer.c:95
#12 0x00007fdd38808f9c in tc_call_texture_subdata() () at ../mesa-23.2.1/src/gallium/auxiliary/util/u_threaded_context.c:3120
#13 0x00007fdd387e8219 in batch_execute () at ../mesa-23.2.1/src/gallium/auxiliary/util/u_threaded_context.c:394
#14 tc_batch_execute() () at ../mesa-23.2.1/src/gallium/auxiliary/util/u_threaded_context.c:445
#15 0x00007fdd3967f72a in _tc_sync.isra.0 () at ../mesa-23.2.1/src/gallium/auxiliary/util/u_threaded_context.c:680
#16 0x00007fdd3880a970 in tc_texture_subdata() () at ../mesa-23.2.1/src/gallium/auxiliary/util/u_threaded_context.c:3219
#17 0x00007fdd3839545e in st_TexSubImage() () at ../mesa-23.2.1/src/mesa/state_tracker/st_cb_texture.c:2132
#18 0x00007fdd3835154d in texture_sub_image () at ../mesa-23.2.1/src/mesa/main/teximage.c:3752
#19 0x00007fdd38352a3d in texsubimage_err () at ../mesa-23.2.1/src/mesa/main/teximage.c:3810
#20 0x00007fdd38352b2c in _mesa_TexSubImage2D () at ../mesa-23.2.1/src/mesa/main/teximage.c:4032
#21 0x00007fdd422c7557 in QOpenGLFunctions::glTexSubImage2D(unsigned int, int, int, int, int, int, unsigned int, unsigned int, void const*) (pixels=0x7fdc94fd6970, type=<optimized out>, format=<optimized out>, height=<optimized out>, width=<optimized out>, yoffset=250, xoffset=<optimized out>, level=<optimized out>, target=<optimized out>, this=<optimized out>, this=<optimized out>, target=<optimized out>, level=<optimized out>, xoffset=<optimized out>, yoffset=<optimized out>, width=<optimized out>, height=<optimized out>, format=<optimized out>, type=<optimized out>, pixels=<optimized out>) at /usr/src/debug/qt6-base/build/include/QtGui/../../../qtbase-everywhere-src-6.6.0/src/gui/opengl/qopenglfunctions.h:1042
#22 QRhiGles2::executeCommandBuffer(QRhiCommandBuffer*) (this=this@entry=0x7fdc94002410, cb=cb@entry=0x7fdc94174498) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.6.0/src/gui/rhi/qrhigles2.cpp:3370
#23 0x00007fdd422cb927 in QRhiGles2::endFrame(QRhiSwapChain*, QFlags<QRhi::EndFrameFlag>) (this=0x7fdc94002410, swapChain=0x7fdc94173f50, flags=...) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.6.0/src/gui/rhi/qrhigles2.cpp:2053
#24 0x00007fdd42189e1c in QRhi::endFrame(QRhiSwapChain*, QFlags<QRhi::EndFrameFlag>) (this=0x7fdc940023f0, swapChain=0x7fdc94173f50, flags=..., flags@entry=...) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.6.0/src/gui/rhi/qrhi.cpp:10181
#25 0x00007fdd43207886 in QSGRenderThread::syncAndRender() (this=<optimized out>) at /usr/include/qt6/QtCore/qflags.h:73
#26 QSGRenderThread::run() (this=0x5564dea62bb0) at /usr/src/debug/qt6-declarative/qtdeclarative-everywhere-src-6.6.0/src/quick/scenegraph/qsgthreadedrenderloop.cpp:946
#27 0x00007fdd41ac97b3 in operator() (__closure=<optimized out>) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.6.0/src/corelib/thread/qthread_unix.cpp:324
#28 (anonymous namespace)::terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> > (t=<optimized out>) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.6.0/src/corelib/thread/qthread_unix.cpp:260
#29 QThreadPrivate::start(void*) (arg=0x5564dea62bb0) at /usr/src/debug/qt6-base/qtbase-everywhere-src-6.6.0/src/corelib/thread/qthread_unix.cpp:283
#30 0x00007fdd412aa9eb in start_thread (arg=<optimized out>) at pthread_create.c:444
#31 0x00007fdd4132e7cc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

this crash is deep in the graphics driver
Comment 4 Patrick Silva 2025-03-27 15:44:04 UTC
Cannot reproduce.

Operating System: Arch Linux 
KDE Plasma Version: 6.3.3
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.2
Graphics Platform: Wayland