Created attachment 143684 [details] TEST FILE SUMMARY If Kate is performing "Search and Replace" operation one can switch to another opened tab, then switch back and get a crash. STEPS TO REPRODUCE 1. Unpack and open the attached text file. 2. Open a new empty tab (Ctrl+T) 3. Switch back to the file 4. Search and replace with values " and an empty string to get rid of " characters in the text. (Use Ctrl+F then "Switch to power search and replace bar") 5. While text is replacing (the file is very big) switch to a new tab. 6. Switch back to the tab where text is replaced OBSERVED RESULT Kate crashed EXPECTED RESULT Kate should show document SOFTWARE/OS VERSIONS Operating System: Kubuntu 21.10 KDE Plasma Version: 5.22.5 KDE Frameworks Version: 5.86.0 Qt Version: 5.15.2 Kernel Version: 5.13.0-21-generic (64-bit) Graphics Platform: X11 Processors: 4 × Intel® Core™ i7-3520M CPU @ 2.90GHz Memory: 7,6 GiB of RAM Graphics Processor: Mesa DRI Intel® HD Graphics 4000 ADDITIONAL INFORMATION I was able to debug it a bit with gdb to get a backtrace: (gdb) backtrace #0 0x00007effc10f4cd9 in KateSearchBar::findOrReplaceAll() () from /lib/x86_64-linux-gnu/libKF5TextEditor.so.5 #1 0x00007effbf3d573e in QObject::event(QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5 #2 0x00007effbfe946b3 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Widgets.so.5 #3 0x00007effbf3a816a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5 #4 0x00007effbf3ab257 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5 #5 0x00007effbf401ef7 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5 #6 0x00007effbd3768bb in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #7 0x00007effbd3c9f08 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #8 0x00007effbd374003 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #9 0x00007effbf401548 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5 #10 0x00007effbf3a6a9b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5 #11 0x00007effbf3af024 in QCoreApplication::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5 #12 0x000055c0f24d865e in main (argc=1, argv=0x7fff27294a78) at /tmp/kate/kate/main.cpp:700
Sorry, instead of 2. Open a new empty tab (Ctrl+T) should be 2. Open a new empty tab (Ctrl+N)
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/246
Git commit 9c887f901dc74c7128bba7c59196ab0663e97a76 by Christoph Cullmann, on behalf of Waqar Ahmed. Committed on 11/01/2022 at 20:34. Pushed by cullmann into branch 'master'. Fix rash when switching between tabs while search is running M +6 -1 src/search/katesearchbar.cpp https://invent.kde.org/frameworks/ktexteditor/commit/9c887f901dc74c7128bba7c59196ab0663e97a76