• Ahmad Samir's avatar
    Search plugin: fix crash with multiline regexp search · 98e22b50
    Ahmad Samir authored
    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
    98e22b50