My Kate is 15.08.2 Kubuntu 15.10 x64 kernel 4.2.0-16-generic I often use Kate to process some text with regexp and yesterday caught a bug. After a few manipulations Kate freezes and starts to consume all available memory until hangs whole system or be killed. It seems that the problem in endless loop or recursion happened in regexp processing. I was trying to split a big line to several lines. For that I need to search for ";\*" regexp. But I made a mistake and forgot the escape char. And just when I pressed "Regular expressions" checkbox I got a system freeze due to no free RAM available. Reproducible: Always Steps to Reproduce: 1. Open Kate with a new file. 2. Paste following text in it. (Without quotes. This is one line ): "*(ns_winners+1) = 0x62;*(ns_winners+1) = 0x63;*(ns_winners+1) = 0x66;*(ns_winners+1) = 0x6f;*(ns_winners+1) = 0x70;*(ns_winners+1) = 0x71;*(ns_winners+1) = 0x76;*(ns_winners+1) = 0x78;*(ns_winners+1) = 0x7c;*(ns_winners+1) = 0x8b;*(ns_winners+1) = 0xa0;*(ns_winners+1) = 0xbc;*(ns_winners+1) = 0xbd;*(ns_winners+1) = 0xbe;*(ns_winners+1) = 0xbf;*(ns_winners+1) = 0xc0;*(ns_winners+1) = 0xc1;*(ns_winners+1) = 0xc2;*(ns_winners+1) = 0xc8;*(ns_winners+1) = 0xc9;*(ns_winners+1) = 0xca;*(ns_winners+1) = 0xcb;*(ns_winners+1) = 0xcc;*(ns_winners+1) = 0xcf;*(ns_winners+1) = 0xd0;*(ns_winners+1) = 0xdf;*(ns_winners+1) = 0xe1" 3. Now press Ctr+F to open "search and replace" tab at bottom. 4. Type in ";*" in Find edit box (without quotes). The sequences will highlights with yellow. 5. Open advanced options with button to the left from Find edit box and check the "Regular expressions" checkbox. The endless memory allocation starts just after step 5. Actual Results: Kate freezes and greedy allocates all available memory. Expected Results: Kate doesn't freeze and display search results (no idea how would they looks like in this case) and not consume all my RAM. Frankly to say, this is a first time I faced with such problem while working with regexps in Kate for last 2 years. Well, may be second one.
I can confirm this issue on freshly updated Arch 64-bit with linux-lts-4.1.15-1 kernel. It can also be reproduced when Regular expression checkbox is checked and Find box contains any single character followed by * or ? Example: .* Another one: 1? It doesn't matter what text is being edited, the issue exists even in an empty new document.
There is definitely something wrong. I get "620 matches found", even though there are just 26... Needs investigation.
So the thing is the following: The string in the bug report is just in one line and contains 620 columns. The regular expression ";*" means match ';' as often as possible. But even an empty string counts as match. So we get 620 matches, just as many characters as we have in the document.
> Kate freezes and greedy allocates all available memory. Can't reproduce this now, so the main issue seems to be fixed Frameworks 5.53.0 Kate 19.03.70
Hmm, I can't reproduce the out-of-memory either. We fixed some issues with search during this year, thought.