Bug 480489 - Kate crashes when using search tab
Summary: Kate crashes when using search tab
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 23.08.4
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2024-01-29 13:39 UTC by Alexander Wilms
Modified: 2024-03-14 17:03 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Wilms 2024-01-29 13:39:31 UTC
Application: kate (23.08.4)

Qt Version: 5.15.12
Frameworks Version: 5.114.0
Operating System: Linux 6.7.1-3-default x86_64
Windowing System: X11
Distribution: "openSUSE Tumbleweed"
DrKonqi: 5.27.10 [KCrashBackend]

-- Information about the crash:
I was searching for `enum` in a clone of https://github.com/vcmi/vcmi

Every time, it shows the status `235 matches found, searching: /proc/kallsyms` just prior to the crash

Perhaps it's accidentally searching the entire file system?

The crash can be reproduced every time.

-- Backtrace:
Application: Kate (kate), signal: Aborted

[KCrash Handler]
#4  0x00007fa3cc891dec in __pthread_kill_implementation () at /lib64/libc.so.6
#5  0x00007fa3cc83f0c6 in raise () at /lib64/libc.so.6
#6  0x00007fa3cc8268d7 in abort () at /lib64/libc.so.6
#7  0x00007fa3cccacc37 in  () at /lib64/libstdc++.so.6
#8  0x00007fa3cccbc21c in  () at /lib64/libstdc++.so.6
#9  0x00007fa3cccbc287 in  () at /lib64/libstdc++.so.6
#10 0x00007fa3cd0ba6f7 in qTerminate() () at global/qglobal.cpp:3383
#11 0x00007fa3cd0bc4a2 in (anonymous namespace)::terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> > (t=<optimized out>) at thread/qthread_unix.cpp:297
#12 QThreadPrivate::start(void*) (arg=0x556fd289f5f0) at thread/qthread_unix.cpp:310
#13 0x00007fa3cc88ff44 in start_thread () at /lib64/libc.so.6
#14 0x00007fa3cc9184ec in clone3 () at /lib64/libc.so.6

Thread 13 (Thread 0x7fa3892006c0 (LWP 10969) "Thread (pooled)"):
#1  QTextStream::readLineInto(QString*, long long) (this=<optimized out>, line=0x7fa3891ffa50, maxlen=0) at serialization/qtextstream.cpp:1718
#2  0x00007fa3c4078956 in  () at /usr/lib64/qt5/plugins/ktexteditor/katesearchplugin.so
#3  0x00007fa3cd1077b2 in QThreadPoolThread::run() (this=0x556fd289f2f0) at thread/qthreadpool.cpp:100
#4  0x00007fa3cd10427d in operator() (__closure=<optimized out>) at thread/qthread_unix.cpp:350
#5  (anonymous namespace)::terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> > (t=<optimized out>) at thread/qthread_unix.cpp:287
#6  QThreadPrivate::start(void*) (arg=0x556fd289f2f0) at thread/qthread_unix.cpp:310
#7  0x00007fa3cc88ff44 in start_thread () at /lib64/libc.so.6
#8  0x00007fa3cc9184ec in clone3 () at /lib64/libc.so.6

Thread 12 (Thread 0x7fa389c006c0 (LWP 10968) "Thread (pooled)"):
#1  QTextStream::readLineInto(QString*, long long) (this=<optimized out>, line=0x7fa389bffa50, maxlen=0) at serialization/qtextstream.cpp:1718
#2  0x00007fa3c4078956 in  () at /usr/lib64/qt5/plugins/ktexteditor/katesearchplugin.so
#3  0x00007fa3cd1077b2 in QThreadPoolThread::run() (this=0x556fd289eff0) at thread/qthreadpool.cpp:100
#4  0x00007fa3cd10427d in operator() (__closure=<optimized out>) at thread/qthread_unix.cpp:350
#5  (anonymous namespace)::terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> > (t=<optimized out>) at thread/qthread_unix.cpp:287
#6  QThreadPrivate::start(void*) (arg=0x556fd289eff0) at thread/qthread_unix.cpp:310
#7  0x00007fa3cc88ff44 in start_thread () at /lib64/libc.so.6
#8  0x00007fa3cc9184ec in clone3 () at /lib64/libc.so.6

Thread 11 (Thread 0x7fa39b4006c0 (LWP 10967) "Thread (pooled)"):
#1  QTextStream::readLineInto(QString*, long long) (this=<optimized out>, line=0x7fa39b3ffa50, maxlen=0) at serialization/qtextstream.cpp:1718
#2  0x00007fa3c4078956 in  () at /usr/lib64/qt5/plugins/ktexteditor/katesearchplugin.so
#3  0x00007fa3cd1077b2 in QThreadPoolThread::run() (this=0x556fd28a1b30) at thread/qthreadpool.cpp:100
#4  0x00007fa3cd10427d in operator() (__closure=<optimized out>) at thread/qthread_unix.cpp:350
#5  (anonymous namespace)::terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> > (t=<optimized out>) at thread/qthread_unix.cpp:287
#6  QThreadPrivate::start(void*) (arg=0x556fd28a1b30) at thread/qthread_unix.cpp:310
#7  0x00007fa3cc88ff44 in start_thread () at /lib64/libc.so.6
#8  0x00007fa3cc9184ec in clone3 () at /lib64/libc.so.6

Thread 10 (Thread 0x7fa39be006c0 (LWP 10966) "Thread (pooled)"):
#1  QTextStream::readLineInto(QString*, long long) (this=<optimized out>, line=0x7fa39bdffa50, maxlen=0) at serialization/qtextstream.cpp:1718
#2  0x00007fa3c4078956 in  () at /usr/lib64/qt5/plugins/ktexteditor/katesearchplugin.so
#3  0x00007fa3cd1077b2 in QThreadPoolThread::run() (this=0x556fd29eb0e0) at thread/qthreadpool.cpp:100
#4  0x00007fa3cd10427d in operator() (__closure=<optimized out>) at thread/qthread_unix.cpp:350
#5  (anonymous namespace)::terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> > (t=<optimized out>) at thread/qthread_unix.cpp:287
#6  QThreadPrivate::start(void*) (arg=0x556fd29eb0e0) at thread/qthread_unix.cpp:310
#7  0x00007fa3cc88ff44 in start_thread () at /lib64/libc.so.6
#8  0x00007fa3cc9184ec in clone3 () at /lib64/libc.so.6

Thread 9 (Thread 0x7fa3994006c0 (LWP 9838) "kate"):
#1  0x00007fa3c9839b37 in  () at /lib64/libusbmuxd-2.0.so.6
#2  0x00007fa3c983a7a3 in  () at /lib64/libusbmuxd-2.0.so.6
#3  0x00007fa3cc88ff44 in start_thread () at /lib64/libc.so.6
#4  0x00007fa3cc9184ec in clone3 () at /lib64/libc.so.6

Thread 8 (Thread 0x7fa3aaa006c0 (LWP 9821) "kate:traceq0"):
#1  0x00007fa3cc88f230 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libc.so.6
#2  0x00007fa3bdf0f3eb in  () at /usr/lib64/dri/radeonsi_dri.so
#3  0x00007fa3bdf04657 in  () at /usr/lib64/dri/radeonsi_dri.so
#4  0x00007fa3cc88ff44 in start_thread () at /lib64/libc.so.6
#5  0x00007fa3cc9184ec in clone3 () at /lib64/libc.so.6

Thread 7 (Thread 0x7fa3ab4006c0 (LWP 9820) "kate:traceq0"):
#1  0x00007fa3cc88f230 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libc.so.6
#2  0x00007fa3bdf0f3eb in  () at /usr/lib64/dri/radeonsi_dri.so
#3  0x00007fa3bdf04657 in  () at /usr/lib64/dri/radeonsi_dri.so
#4  0x00007fa3cc88ff44 in start_thread () at /lib64/libc.so.6
#5  0x00007fa3cc9184ec in clone3 () at /lib64/libc.so.6

Thread 6 (Thread 0x7fa3abe006c0 (LWP 9819) "kate:shlo0"):
#1  0x00007fa3cc88f230 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libc.so.6
#2  0x00007fa3bdf0f3eb in  () at /usr/lib64/dri/radeonsi_dri.so
#3  0x00007fa3bdf04657 in  () at /usr/lib64/dri/radeonsi_dri.so
#4  0x00007fa3cc88ff44 in start_thread () at /lib64/libc.so.6
#5  0x00007fa3cc9184ec in clone3 () at /lib64/libc.so.6

Thread 5 (Thread 0x7fa3bd2006c0 (LWP 9818) "kate:sh0"):
#1  0x00007fa3cc88f230 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libc.so.6
#2  0x00007fa3bdf0f3eb in  () at /usr/lib64/dri/radeonsi_dri.so
#3  0x00007fa3bdf04657 in  () at /usr/lib64/dri/radeonsi_dri.so
#4  0x00007fa3cc88ff44 in start_thread () at /lib64/libc.so.6
#5  0x00007fa3cc9184ec in clone3 () at /lib64/libc.so.6

Thread 4 (Thread 0x7fa3bdc006c0 (LWP 9817) "kate:disk$0"):
#1  0x00007fa3cc88f230 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libc.so.6
#2  0x00007fa3bdf0f3eb in  () at /usr/lib64/dri/radeonsi_dri.so
#3  0x00007fa3bdf04657 in  () at /usr/lib64/dri/radeonsi_dri.so
#4  0x00007fa3cc88ff44 in start_thread () at /lib64/libc.so.6
#5  0x00007fa3cc9184ec in clone3 () at /lib64/libc.so.6

Thread 3 (Thread 0x7fa3c50006c0 (LWP 9816) "kate:cs0"):
#1  0x00007fa3cc88f230 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libc.so.6
#2  0x00007fa3bdf0f3eb in  () at /usr/lib64/dri/radeonsi_dri.so
#3  0x00007fa3bdf04657 in  () at /usr/lib64/dri/radeonsi_dri.so
#4  0x00007fa3cc88ff44 in start_thread () at /lib64/libc.so.6
#5  0x00007fa3cc9184ec in clone3 () at /lib64/libc.so.6

Thread 2 (Thread 0x7fa3c6e006c0 (LWP 9813) "QDBusConnection"):
#1  0x00007fa3cab15aff in  () at /lib64/libglib-2.0.so.0
#2  0x00007fa3cab1620c in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#3  0x00007fa3cd346876 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x7fa3c0000b70, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#4  0x00007fa3cd2ec3cb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fa3c6dffb50, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#5  0x00007fa3cd10304e in QThread::exec() (this=<optimized out>) at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#6  0x00007fa3ce71a517 in  () at /lib64/libQt5DBus.so.5
#7  0x00007fa3cd10427d in operator() (__closure=<optimized out>) at thread/qthread_unix.cpp:350
#8  (anonymous namespace)::terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> > (t=<optimized out>) at thread/qthread_unix.cpp:287
#9  QThreadPrivate::start(void*) (arg=0x7fa3ce793060) at thread/qthread_unix.cpp:310
#10 0x00007fa3cc88ff44 in start_thread () at /lib64/libc.so.6
#11 0x00007fa3cc9184ec in clone3 () at /lib64/libc.so.6

Thread 1 (Thread 0x7fa3c9355180 (LWP 9812) "kate"):
#1  0x00007fa3cd10627b in QtLinuxFutex::_q_futex(int*, int, int, unsigned long long, int*, int) (val3=0, addr2=0x0, val2=0, val=<optimized out>, op=0, addr=<optimized out>) at thread/qfutex_p.h:114
#2  QtLinuxFutex::futexWait<QBasicAtomicInteger<unsigned int> >(QBasicAtomicInteger<unsigned int>&, QBasicAtomicInteger<unsigned int>::Type) (expectedValue=<optimized out>, futex=<optimized out>) at thread/qfutex_p.h:133
#3  futexSemaphoreTryAcquire_loop<false>(QBasicAtomicInteger<unsigned long long>&, unsigned long long, unsigned long long, int) (timeout=-1, nn=8589934593, curValue=<optimized out>, u=...) at thread/qsemaphore.cpp:219
#4  futexSemaphoreTryAcquire<false>(QBasicAtomicInteger<unsigned long long>&, int, int) (timeout=-1, n=n@entry=1, u=...) at thread/qsemaphore.cpp:262
#5  QSemaphore::acquire(int) (this=this@entry=0x7ffc23a66730, n=n@entry=1) at thread/qsemaphore.cpp:326
#6  0x00007fa3cd325ce1 in doActivate<false>(QObject*, int, void**) (sender=0x556fd1490cf0, signal_index=0, argv=0x7ffc23a667b0) at kernel/qobject.cpp:3906
#7  0x00007fa3cd31e84f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x556fd1490cf0, m=m@entry=0x7fa3cd5c0840, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffc23a667b0) at kernel/qobject.cpp:3985
#8  0x00007fa3cd31e8ff in QObject::destroyed(QObject*) (this=this@entry=0x556fd1490cf0, _t1=<optimized out>, _t1@entry=0x556fd1490cf0) at .moc/moc_qobject.cpp:219
#9  0x00007fa3cd3237f8 in QObject::~QObject() (this=<optimized out>, __in_chrg=<optimized out>) at kernel/qobject.cpp:1010
#10 0x00007fa3ccb8f0e9 in OrgKdeKDirNotifyInterface::~OrgKdeKDirNotifyInterface() () at /lib64/libKF5KIOCore.so.5
#11 0x00007fa3cd31728e in QObjectPrivate::deleteChildren() (this=this@entry=0x556fd0e54470) at kernel/qobject.cpp:2137
#12 0x00007fa3cd323584 in QObject::~QObject() (this=<optimized out>, __in_chrg=<optimized out>) at kernel/qobject.cpp:1115
#13 0x00007fa3ccb6f499 in  () at /lib64/libKF5KIOCore.so.5
#14 0x00007fa3cc841b06 in __run_exit_handlers () at /lib64/libc.so.6
#15 0x00007fa3cc841c50 in  () at /lib64/libc.so.6
#16 0x00007fa3c6ec9ad4 in QXcbConnection::processXcbEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x556fd0788080, flags=...) at qxcbconnection.cpp:1051
#17 0x00007fa3c6ef9563 in xcbSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>) at qxcbeventdispatcher.cpp:103
#18 0x00007fa3cab13f30 in  () at /lib64/libglib-2.0.so.0
#19 0x00007fa3cab15b58 in  () at /lib64/libglib-2.0.so.0
#20 0x00007fa3cab1620c in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#21 0x00007fa3cd346876 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x556fd0859560, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#22 0x00007fa3cd2ec3cb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffc23a66c30, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#23 0x00007fa3cd2f4860 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#24 0x0000556fcefb2478 in  ()
#25 0x00007fa3cc8281b0 in __libc_start_call_main () at /lib64/libc.so.6
#26 0x00007fa3cc828279 in __libc_start_main_impl () at /lib64/libc.so.6
#27 0x0000556fcefb4835 in  ()
[Inferior 1 (process 9812) detached]

Reported using DrKonqi
Comment 1 Waqar Ahmed 2024-01-30 13:24:27 UTC
Yes, just change the search mode to "Current Project" or specify a folder if you want to search with "In Folder" mode.

Besides, search plugin should warn the user if the selected directory is root.
Comment 2 Christoph Cullmann 2024-02-03 16:46:27 UTC
Beside that I think we should add some internal limits to not just OOM on large files.
Comment 3 Alexander Wilms 2024-02-03 17:54:10 UTC
Apropos large files, the next file in /proc after /proc/kallsyms (which is 0 B in size) is /proc/kcore. Dolphin shows its size as 128,0 TiB (140.737.471.594.496).
Comment 4 Christoph Cullmann 2024-03-10 18:25:37 UTC
https://invent.kde.org/utilities/kate/-/merge_requests/1418
Comment 5 Christoph Cullmann 2024-03-14 17:03:45 UTC
Git commit adc3f1987bb7a5f522542a87dc130515fc965402 by Christoph Cullmann.
Committed on 14/03/2024 at 17:03.
Pushed by cullmann into branch 'master'.

add size limit config option to search in files

M  +7    -1    addons/search/SearchDiskFiles.cpp
M  +3    -2    addons/search/SearchDiskFiles.h
M  +9    -12   addons/search/SearchPlugin.cpp
M  +1    -1    addons/search/SearchPlugin.h
M  +31   -9    addons/search/search.ui

https://invent.kde.org/utilities/kate/-/commit/adc3f1987bb7a5f522542a87dc130515fc965402