Commit 98e22b50 authored by Ahmad Samir's avatar Ahmad Samir
Browse files

Search plugin: fix crash with multiline regexp search

SearchDiskFiles::searchMultiLineRegExp() had two local static variables,
it looks like after some recent changes, this causes a crash:

0  QVector<int>::realloc (this=this@entry=0x7ffff0079080 <SearchDiskFiles::searchMultiLineRegExp(QFile&)::lineStart>, aalloc=<optimized out>, options=...,
options@entry=...) at /usr/include/qt5/QtCore/qvector.h:719
1  0x00007ffff005586d in QVector<int>::detach (this=0x7ffff0079080 <SearchDiskFiles::searchMultiLineRegExp(QFile&)::lineStart>)
at /usr/include/qt5/QtCore/qvector.h:410
2  QVector<int>::detach (this=0x7ffff0079080 <SearchDiskFiles::searchMultiLineRegExp(QFile&)::lineStart>) at /usr/include/qt5/QtCore/qvector.h:402
3  QVector<int>::end (this=0x7ffff0079080 <SearchDiskFiles::searchMultiLineRegExp(QFile&)::lineStart>) at /usr/include/qt5/QtCore/qvector.h:223
4  QVector<int>::clear (this=0x7ffff0079080 <SearchDiskFiles::searchMultiLineRegExp(QFile&)::lineStart>) at /usr/include/qt5/QtCore/qvector.h:449
5  QVector<int>::clear (this=0x7ffff0079080 <SearchDiskFiles::searchMultiLineRegExp(QFile&)::lineStart>) at /usr/include/qt5/QtCore/qvector.h:445
6  SearchDiskFiles::searchMultiLineRegExp (this=this@entry=0x555556fd3150, file=...) at /home/ahmad/kdesrc/applications/kate/addons/search/SearchDiskFiles.cpp:141
7  0x00007ffff0055b1e in SearchDiskFiles::run (this=0x555556fd3150) at /home/ahmad/kdesrc/applications/kate/addons/search/SearchDiskFiles.cpp:51
8  0x00007ffff5bc91f2 in QThreadPoolThread::run (this=0x555556fd33b0) at thread/qthreadpool.cpp:100
9  0x00007ffff5bc5ef1 in QThreadPrivate::start (arg=0x555556fd33b0) at thread/qthread_unix.cpp:329
10 0x00007ffff4bcc299 in start_thread () from /lib64/libpthread.so.0
11 0x00007ffff5686af3 in clone () from /lib64/libc.so.6
parent 5732acde
......@@ -120,8 +120,8 @@ QVector<KateSearchMatch> SearchDiskFiles::searchMultiLineRegExp(QFile &file)
{
int column = 0;
int line = 0;
static QString fullDoc;
static QVector<int> lineStart;
QString fullDoc;
QVector<int> lineStart;
QRegularExpression tmpRegExp = m_regExp;
QVector<KateSearchMatch> matches;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment