Bug 100535 - RegEx Search-Replace with Text Box causes infinite loop
Summary: RegEx Search-Replace with Text Box causes infinite loop
Status: RESOLVED DUPLICATE of bug 98224
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) release
Hardware: All All
: medium major
Assignee: Not Assigned
Keywords: regression
Depends on:
Reported: 2016-06-22 04:26 UTC by Frank Zimmerman
Modified: 2016-06-22 15:28 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:

Document that crashes during Find & Replace (with an extra step) (8.89 KB, application/vnd.oasis.opendocument.text)
2016-06-22 06:11 UTC, Aron Budea

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Zimmerman 2016-06-22 04:26:05 UTC
Steps to reproduce:

1. Create New Writer document.
2. Press Enter to create a second line.
3. Insert a Text box (type some text, ie. "Test").
4. Click out of the Text Box.
5. Press Ctrl-H to open Search dialog.
6. Check "regular expressions" under "Other options".
7. Enter " *$" (space-asterisk-dollar sign) in the Search field. Leave Replace blank. (this RegEx is to remove trailing spaces).
8. Press "Replace All".

This causes an infinite loop (Windows says "LibreOffice has stopped responding").

This bug has been present for quite a while, I just didn't report it until now. I found it because I often work with electronic books and use a Text Box for the Cover title, as I can control the shadowing depth.

If the Text Box is not in the document, the search/replace works fine.

My workaround for now is to select all the text I want to search, then check "current selection only" in the Search dialog.
Comment 1 Aron Budea 2016-06-22 06:11:22 UTC
Created attachment 125819 [details]
Document that crashes during Find & Replace (with an extra step)

Reproduced with,, also in Linux. Not reproduced with Also not reproduced with (but I'm getting other issues with Find&Replace there).

Reproducing this is a bit tricky. To make it easier, I created a document based on the steps. If I open the document and make no changes, it doesn't freeze during the Find&Replace (regex + " *$"), but if I press Down, then Enter (eg. add a new line at the end), then Find&Replace freezes LO.

Since LO 5.1.4 is around the corner ( RC is out), I'm closing this as WORKSFORME, please test with that release. I'll create a new bug report on the new issues, and post it here.
Comment 2 Aron Budea 2016-06-22 06:50:18 UTC
Bug 100538 has been opened as a follow-up.
Comment 3 Aron Budea 2016-06-22 06:58:33 UTC
*** Bug 99803 has been marked as a duplicate of this bug. ***
Comment 4 Aron Budea 2016-06-22 15:28:04 UTC
I believe the crash is gone due to a similar issue, bug 98224 getting fixed.

*** This bug has been marked as a duplicate of bug 98224 ***