Bug 445683 - Crash when switching between documents tab while search and replace is performing
Summary: Crash when switching between documents tab while search and replace is perfor...
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: search (show other bugs)
Version: 21.08.1
Platform: Kubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-18 09:51 UTC by Alexander Trufanov
Modified: 2022-01-11 20:40 UTC (History)
1 user (show)

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


Attachments
TEST FILE (1.09 MB, application/zip)
2021-11-18 09:51 UTC, Alexander Trufanov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Trufanov 2021-11-18 09:51:13 UTC
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
Comment 1 Alexander Trufanov 2021-11-18 09:52:46 UTC
Sorry, instead of
2. Open a new empty tab (Ctrl+T)
should be
2. Open a new empty tab (Ctrl+N)
Comment 2 Bug Janitor Service 2022-01-11 07:02:11 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/246
Comment 3 Christoph Cullmann 2022-01-11 20:40:28 UTC
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