After selecting several lines then using the following command, KATE locks up the CPU: :'<,'>s/\s*|\s*/', '/g After a few minutes I had to kill -9 the Kate process. When I then tried to open the file again in Kate, I got the message that the file was not closed appropriately. When I tried to recover, Kate locked up gain and needed kill -9. Unfortunately I cannot post the swap file here as it contains sensitive information. Reproducible: Always
Hi Dotan, nice catch!;-) I can replicate and I've already saw what is going on. It's not vi-mode problem. But I'm interested... what were you trying accomplish with that substitution command? If I read it correctly it could pretty much match the "". And the "|\s*" is pretty much an error isn't it? Still the kate should go for endless loop like that. For the swap file recovery... that command you've wrote caused an enormous amout of changes on the document, so when you've tried to recover, swap recovery process tried to do the same thing as the subtitution command. So that one was actually acting correctly according to input.
Note to myself or anyone willing to fix it. Problem lies somewhere in KateCommands::SedReplace::InteractiveSedReplacer::replaceCurrentMatch or KateRegExpSearch::search Depends how you look at it. Be aware of simple fixes that lead to breaking up the "s/$/x/g" case.
Git commit 9ff1f156d80a2c48386fd58a72401ea6a84d5bce by Michal Humpula. Committed on 22/02/2014 at 20:41. Pushed by michalhumpula into branch 'master'. vi-mode: fix deadly s/\s*/x/g loop FIXED-IN: 4.13 M +19 -10 part/utils/katecmds.cpp M +2 -0 tests/vimode_test.cpp http://commits.kde.org/kate/9ff1f156d80a2c48386fd58a72401ea6a84d5bce
Great Michal, thank you!