Bug 139483 - Find and Replace (with regular expression option) freezes when globally replace end of paragraph ($) with another character (##) in this case
Summary: Find and Replace (with regular expression option) freezes when globally repla...
Status: RESOLVED INSUFFICIENTDATA
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.0.4.2 release
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 139484 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-01-07 19:20 UTC by dlphan
Modified: 2022-09-16 03:41 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Attached is the file for which Find and Replace fail (114.88 KB, application/x-zip-compressed)
2021-01-07 19:20 UTC, dlphan
Details
2 page document before replacing characters (150.44 KB, image/png)
2021-02-27 12:39 UTC, Andy Hird
Details
2 page document after replacing chars, with extra text added to header (162.98 KB, image/png)
2021-02-27 12:39 UTC, Andy Hird
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dlphan 2021-01-07 19:20:28 UTC
Created attachment 168757 [details]
Attached is the file for which Find and Replace fail

Find and Replace (with regular expression option) freezes when globally replace end of paragraph ($) with another character (##) in this case.

When I try to replace the paragraph mark ($) with ## globally, LibreOffice freezes.  I can not save, close the Find and Replace Dialog or even exit.
I had to use Task Scheduler to terminate LibreOffice.

This is on Window 7, LibreOffice 7.0.4.2 (32 bit version).
Comment 1 m_a_riosv 2021-01-07 19:43:43 UTC
*** Bug 139484 has been marked as a duplicate of this bug. ***
Comment 2 Andy Hird 2021-02-27 12:39:05 UTC
Created attachment 170112 [details]
2 page document before replacing characters
Comment 3 Andy Hird 2021-02-27 12:39:45 UTC
Created attachment 170113 [details]
2 page document after replacing chars, with extra text added to header
Comment 4 Andy Hird 2021-02-27 12:41:15 UTC
I have been able to reproduce the crash with the following configuration. But so far, only using the originally attached document.
 

LibreOffice version:    7.1.1.1
LibreOffice Build:      575c5867c4cc13d7ae78f9ce39a54a52ed38c769
Operating System:      Windows 10 (x64) Build 19042


Steps I’m taking (using the original sample document):

* Open Find/Replace and set it to Find '$' (with regular expressions) and set it to Replace with any text.

* Using ‘Replace’ (instead of ‘Replace All’) to replace one at a time:  The Find/Replace operation completes okay going through some of the document. Sometimes there will be a delay and at others it will complete quickly. 

* When the 'end of paragraph' character in the heading is replaced on the first page, the heading (not a header) is combined with the rest of the text on the first page as a single paragraph. (This may or may not be relevant to causing the actual problem.)

* When the 'end of paragraph' character in the HEADER on the second page is replaced, something happens that causes text from first page to be ADDED to the header.

* It’s at this point (if not sooner) that the program becomes unresponsive.


Observations:

1. To confirm from the original report, searching for and replacing the 'end of paragraph' character (using regular expression $) is likely part of the problem. That may be what is causing the Heading on the first page to merge with the first paragraph.

2. The character put in its place does not appear to make a difference. I have seen the crash with letters and numbers as well (‘apple’, ‘123’, etc.).

3. The first page heading is somehow tied to the header which is displayed on ALL the other pages.

4. When text from the first page is added to the Header shown on every page, that makes the document grow in size. I have seen it go from 26 to 96 pages. (It might have grown more, but the program crashed.) So the problem may be more likely with longer documents.

5. The document growing in size seems to be tied to the program crashing, but I have seen it also become temporarily unresponsive for a moment when doing a find/replace elsewhere in the document as well.


I have NOT been able to reproduce this on a brand-new document. So I am not sure what configuration for the program or particular content in the original document may be contributing to the problem.

But I can illustrate the problem on a revised version of the original document. Effectively, I trimmed the document down to 2 pages and replaced the first paragraph on the first page to just be the letter ‘A’ (see attached ‘Before.PNG’) to make it obvious which text is being added to the Header.

* After doing a Replace All, the paragraph of all ‘AAAA’s is added to the Header, seen in the Header on Page 2 onward (see ‘After.PNG’ – I zoomed out so multiple pages can be seen).

* The document grew from 2 to 9 pages.

* Even with just a 2-page document to start, the program did become unresponsive.
Comment 5 Dieter 2022-02-16 18:58:18 UTC
A new major release of LibreOffice is available since this bug was reported. Could you please try to reproduce it with the latest version of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the latest version.
Comment 6 QA Administrators 2022-08-16 04:01:02 UTC Comment hidden (obsolete)
Comment 7 QA Administrators 2022-09-16 03:41:15 UTC
Dear dlphan,

Please read this message in its entirety before proceeding.

Your bug report is being closed as INSUFFICIENTDATA due to inactivity and
a lack of information which is needed in order to accurately
reproduce and confirm the problem. We encourage you to retest
your bug against the latest release. If the issue is still
present in the latest stable release, we need the following
information (please ignore any that you've already provided):

a) Provide details of your system including your operating
   system and the latest version of LibreOffice that you have
   confirmed the bug to be present

b) Provide easy to reproduce steps – the simpler the better

c) Provide any test case(s) which will help us confirm the problem

d) Provide screenshots of the problem if you think it might help

e) Read all comments and provide any requested information

Once all of this is done, please set the bug back to UNCONFIRMED
and we will attempt to reproduce the issue. Please do not:

a) respond via email 

b) update the version field in the bug or any of the other details
   on the top section of our bug tracker

Warm Regards,
QA Team

MassPing-NeedInfo-FollowUp