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.
Created attachment 125819 [details] Document that crashes during Find & Replace (with an extra step) Reproduced with 5.1.3.2, 5.0.0.5, also in Linux. Not reproduced with 4.4.0.3. Also not reproduced with 5.1.4.1 (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 (5.1.4.2 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.
Bug 100538 has been opened as a follow-up.
*** Bug 99803 has been marked as a duplicate of this bug. ***
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 ***