Bug 131431 - Find & Replace dialog: LO hangs on formatting replacement when thousands of replacements to do
Summary: Find & Replace dialog: LO hangs on formatting replacement when thousands of r...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 155450 (view as bug list)
Depends on:
Blocks: Find&Replace-Dialog
  Show dependency treegraph
 
Reported: 2020-03-20 03:09 UTC by kaanchan
Modified: 2023-05-24 08:51 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot (10.34 KB, image/png)
2020-03-20 03:11 UTC, kaanchan
Details
sample file (55.30 KB, application/vnd.oasis.opendocument.text)
2022-03-27 13:51 UTC, Dieter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kaanchan 2020-03-20 03:09:51 UTC
Description:
I tried to search for any character that was a particular font in bold. When I pressed Replace All, a prompt appeared saying "to continue Undo must be disabled". I accepted, then progress wheel appeared for an indefinite time (I waited 15 minutes before aborting).

Steps to Reproduce:
1. Open document
2. Open Find & Replace dialogue
3. Place cursor in Find field
4. Select a font in Format dialogue which appears many times in document
5. Place cursor in Replace field
6. In Format dialogue select same font previously selected from Font tab in step 4 and select a background color (yellow) from Highlight tab 
7. Click Replace All

Actual Results:
1. After 60,000 character replacements, prompt appears "To proceed with this action, you must first turn off the "undo" function. Do you want to turn off the "undo" function?"
2. Clicking No or Cancel resumes normal control of the application. Clicking Yes results in indefinite hanging. 

Expected Results:
1. Clicking Yes should allow the operation to complete.


Reproducible: Always


User Profile Reset: No



Additional Info:
In my document, after 60000 characters replacements, only 286 were remaining. I was able to do a second search/replace with no issue on jus the remaining selection. Clicking "Yes" to turning off the Undo feature seems to go down a code pathway that causes the hanging. 

Version: 6.4.1.2 (x64)
Build ID: 4d224e95b98b138af42a64d84056446d09082932
CPU threads: 12; OS: Windows 10.0 Build 18362; UI render: GL; VCL: win; 
Locale: en-US (en_US); UI-Language: en-US
Calc: threaded
Comment 1 kaanchan 2020-03-20 03:11:41 UTC
Created attachment 158827 [details]
screenshot

Sample input in search/replace dialogue
Comment 2 kaanchan 2020-03-20 03:50:32 UTC
Interesting to note that if I do search and replace in chunks, i.e. without accepting to disbable the Undo feature, then I can still do a single click (ctrl+z) undo of a mass replacement.

Is it then possible for the algorithm to do large search/replace operations in 60,000 character (or whatever defines the limit) chunks? This would allow the user to undo mass changes, which is desired, rather than leave them without Undo feature for such large changes.
Comment 3 Dieter 2020-03-25 18:30:13 UTC
I confirm it with

Version: 7.0.0.0.alpha0+ (x64)
Build ID: 5dcbd1bb557450a2d658a710c163b310c0cee157
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-GB
Calc: CL
Comment 4 QA Administrators 2022-03-26 03:35:50 UTC Comment hidden (obsolete)
Comment 5 Dieter 2022-03-27 13:51:34 UTC
Created attachment 179141 [details]
sample file

Still present in

Version: 7.3.2.2 (x64) / LibreOffice Community
Build ID: 49f2b1bff42cfccbd8f788c8dc32c1c309559be0
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

Tested with attached file
Comment 6 Stéphane Guillou (stragu) 2023-05-24 08:32:55 UTC
*** Bug 155450 has been marked as a duplicate of this bug. ***
Comment 7 Stéphane Guillou (stragu) 2023-05-24 08:51:00 UTC
Reproducible in:

Version: 7.5.3.2 (X86_64) / LibreOffice Community
Build ID: 9f56dff12ba03b9acd7730a5a481eea045e468f3
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

As well as a recent master build:

Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: f4c24da1e7f11664e0d2f688d2531f068e4a3bc0
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Hangs with 100% use of a core.

Same freeze in OOo 3.3, so issue is inherited.

Changing severity to "major" as it's a complete freeze that requires force-quitting and might result in data loss.