Bug 358915 - Search large open file for reg ex 'error|' freezes xorg
Summary: Search large open file for reg ex 'error|' freezes xorg
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: search (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-02 12:07 UTC by Malcolm Boura
Modified: 2016-02-02 16:41 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Malcolm Boura 2016-02-02 12:07:34 UTC
Arch Linux Kate version
Version 15.12.1
Using:
KDE Frameworks 5.18.0
Qt 5.5.1 (built against 5.5.1)
The xcb windowing system

KDE Plasma Version 5.5.4
Kernel Version 4.4.4-3-ARCH
64 bit
CPU 4@3.4G
Memory 7.7GiB

Using search plugin, open files, regular expression, case insensitive
Two files open: One small file with excerpts from a large one 134K, 1300 lines.

Entering expression 'error|warning|failed'
Got as far as the first | and the desktop froze.
Xorg CPU at 100%
Had not recovered after a coffee trip, probably 10 minutes or so. Killing Kate did recover the desktop.

Second run: I started with search in folder plain text. Then switched into open file, regular expression and it worked.

Third: I then deleted the string back to 'error', typed '|' and it froze again.

My guess is that 'error|' resulted in an attempt to build a found list containing 1300 or so items which gave the UI more than it could handle in a sensible time.
Comment 1 Malcolm Boura 2016-02-02 14:15:54 UTC
It is not dependent on file size. Same freeze with a three line file.
Comment 2 Kåre Särs 2016-02-02 14:38:34 UTC
I can reproduce this.

The problem is the empty regexp after | matches also no character and the search continues the search on the line without going forward and thus getting into an eternal loop.

A workaround for the moment is to add the | after the rest of the regexp is entered.
Comment 3 Kåre Särs 2016-02-02 16:40:21 UTC
Git commit 9b3f722ba514097aa4166c04f7a7167209c81584 by Kåre Särs.
Committed on 02/02/2016 at 16:38.
Pushed by sars into branch 'Applications/15.12'.

S&R: Fix eternal loop on unexpected regular expression.
FIXED-IN: 15.12.2

M  +2    -3    addons/search/SearchDiskFiles.cpp
M  +2    -2    addons/search/search_open_files.cpp

http://commits.kde.org/kate/9b3f722ba514097aa4166c04f7a7167209c81584
Comment 4 Kåre Särs 2016-02-02 16:41:37 UTC
Git commit d7acc4ceeeeb0603eefc208a5420ec4036384204 by Kåre Särs.
Committed on 02/02/2016 at 16:41.
Pushed by sars into branch 'master'.

S&R: Fix eternal loop on unexpected regular expression.
FIXED-IN: 15.12.2

M  +2    -3    addons/search/SearchDiskFiles.cpp
M  +2    -2    addons/search/search_open_files.cpp

http://commits.kde.org/kate/d7acc4ceeeeb0603eefc208a5420ec4036384204