Bug 380861 - >> Replace checked << cause a freeze/crash
Summary: >> Replace checked << cause a freeze/crash
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: Git
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-05 13:16 UTC by Matthias
Modified: 2017-06-15 08:29 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias 2017-06-05 13:16:24 UTC
1) git clone https://github.com/KaOSx/apps

2) Open Kate, search and replace, in Folder (above path)

3) Search: pkgdesc= Find: pkg_description= 

4) Hit Search and then Replace checked (980 hits)

All the significant information which I can get out of gdb is: 

"pkg_description='Cross-platform, 3D and historically-based real-time strategy game'" Does not match "pkgdesc\\="

Its Kate 17.04.1 on Qt 5.8.0 and KDE Frameworks 5.34.0 on KaOS
Comment 1 Kåre Särs 2017-06-05 13:35:58 UTC
Thanks for the report!

I have actually also seen this problem when replacing multiple items in many different files.

There are two problems here:
1) The search/replace buttons are not disabled during the replace.
2) There is no indication that there is stuff happening. If you have the Documents tool-view open you can see that there are a bunch of files being opened. Saving all the 980 files will also take a little while without status updates.

If you wait long enough it should run through all the almost 1000 files :)

At least it did here for me (with kate/ktexteditor from master on Neon stable)

Can you confirm that my suspicion is right?
Comment 2 Matthias 2017-06-06 06:19:20 UTC
No, because it worked several times within one, two seconds. 
Now I can reproduce it always, whyever. :)
Comment 3 Christoph Feck 2017-06-14 00:35:52 UTC
Thanks for update; changing status.
Comment 4 Matthias 2017-06-14 06:32:23 UTC
This here is a quick overview about the used hardware, i think the performance should be well enough: https://gist.github.com/ShalokShalom/d7a125b7e2daffc274df994a34219b02
Comment 5 Kåre Särs 2017-06-14 07:04:57 UTC
I have a patch for disabling the buttons during a search and I am working on indicating what file is currently being replaced in (or updating it every x ms)

Only problem is finding time to finish it ;)
Comment 6 Matthias 2017-06-14 14:35:56 UTC
So, the buttons are an issue for the crash, when they are enabled?
Comment 7 Matthias 2017-06-14 14:37:13 UTC
I am willing to test this patch. :)
Comment 8 Kåre Särs 2017-06-14 19:50:04 UTC
Git commit 72e8bd3dcc27a5216003693ceb8fe4d5f7b02ca3 by Kåre Särs.
Committed on 14/06/2017 at 19:45.
Pushed by sars into branch 'master'.

S&R: Disable search buttons while replacing + add replace status

M  +59   -0    addons/search/plugin_search.cpp
M  +2    -0    addons/search/plugin_search.h
M  +7    -1    addons/search/replace_matches.cpp
M  +3    -0    addons/search/replace_matches.h

https://commits.kde.org/kate/72e8bd3dcc27a5216003693ceb8fe4d5f7b02ca3
Comment 9 Kåre Särs 2017-06-14 19:53:38 UTC
Mathias: You can test the disable buttons and replace status from master :) Please close the bug if the change fixes the freeze for you.

Thanks,
  Kåre
Comment 10 Matthias 2017-06-15 08:29:23 UTC
Wonderful, this seems to work perfectly, thanks a lot, dear ^-^