[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#820109: kate: Kate freezes the system (100% CPU) when '\b' is used as a regexp in the Search & Replace tool



Package: kate
Version: 4:15.08.3-1
Severity: important

Dear Maintainer,

when using the 'Search & Replace' tool in kate (not the Ctrl+f find), if
regular expressions are activated, any expression that can match anything, such
as '\b', will cause kate, and the system, to 'freeze', as kate would eat up 100%
of the CPU.

I believe the main problem is that kates tries to match your pattern against
the *current file* *as you're typing it*, even though you've specifically
chosen to "Search in: Folder", and not "Search in: Open Files" or "Search in:
Current File", and have not yet hit the "Search" button.

Even before you've pressed the "Search" button, the matches are highlighted in
the current file, and you position is moved to the first match (again, not for
Ctrl+f find, but for Search & Replace). If you wanted to stay where you were in
the current file, while searching in a folder, you couldn't do that because as
soon as you start typing you could end up in a different place of the open file
(if a match is found).

If you've activated regular expressions for the search, and are changing a
previous pattern, trying to replace '\bfoo\b' by '\bbar\b' for instance, the
moment you've erased 'foo', and are left with '\b\b', it looks like kate finds
that this matches *everything*, and that's why it's eating all the CPU, trying
to report every single match.

The same thing happens if you've already checked the 'regular expressions' box
*before* you start typing the regexp : as soon as you've typed in '\b', this
matches everything again and freezes as well.

So :

* no search should happen with the Search & Replace tool until you press
  the Search button
* searching in a folder should not automatically search in the open file
  as well
* regular expressions should be sanity-checked : any expression that
  matches everything shoud trigger a warning

Thanks a lot.



-- System Information:
Debian Release: stretch/sid
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages kate depends on:
ii  kate5-data                               4:15.08.3-1
ii  ktexteditor-katepart                     5.16.0-1
ii  libc6                                    2.22-5
ii  libgit2-23                               0.23.1-1.1
ii  libkf5activities5                        5.16.0-1
ii  libkf5bookmarks5                         5.16.0-1
ii  libkf5completion5                        5.16.0-1
ii  libkf5configcore5                        5.16.0-1
ii  libkf5configgui5                         5.16.0-1
ii  libkf5configwidgets5                     5.16.0-1
ii  libkf5coreaddons5                        5.16.0-1
ii  libkf5dbusaddons5                        5.16.0-1
ii  libkf5guiaddons5                         5.16.0-1
ii  libkf5i18n5                              5.16.0-1
ii  libkf5iconthemes5                        5.16.0-1
ii  libkf5itemmodels5                        5.16.0-1
ii  libkf5jobwidgets5                        5.16.0-1
ii  libkf5kiocore5                           5.16.0-1
ii  libkf5kiofilewidgets5                    5.16.0-1
ii  libkf5kiowidgets5                        5.16.0-1
ii  libkf5newstuff5                          5.16.0-1
ii  libkf5notifications5                     5.16.0-1
ii  libkf5parts5                             5.16.0-1
ii  libkf5plasma5                            5.16.0-1
ii  libkf5service-bin                        5.16.0-1
ii  libkf5service5                           5.16.0-1
ii  libkf5texteditor5                        5.16.0-1
ii  libkf5textwidgets5                       5.16.0-1
ii  libkf5threadweaver5                      5.16.0-1
ii  libkf5wallet-bin                         5.16.0-1
ii  libkf5wallet5                            5.16.0-1
ii  libkf5widgetsaddons5                     5.16.0-1
ii  libkf5windowsystem5                      5.16.0-1
ii  libkf5xmlgui5                            5.16.0-1
ii  libqt5core5a                             5.5.1+dfsg-16
ii  libqt5dbus5                              5.5.1+dfsg-16
ii  libqt5gui5                               5.5.1+dfsg-16
ii  libqt5sql5                               5.5.1+dfsg-16
ii  libqt5widgets5                           5.5.1+dfsg-16
ii  libqt5xml5                               5.5.1+dfsg-16
ii  libstdc++6                               5.3.1-13
ii  plasma-framework                         5.16.0-1
ii  qml-module-org-kde-kquickcontrolsaddons  5.16.0-1
ii  qml-module-qtquick-layouts               5.5.1-2
ii  qml-module-qtquick2                      5.5.1-3

kate recommends no packages.

Versions of packages kate suggests:
ii  aspell         0.60.7~20110707-3+b1
ii  ispell         3.4.00-5
ii  khelpcenter    4:5.4.3-1
ii  konsole-kpart  4:15.08.3-1

-- no debconf information


Reply to: