Bug 41738 - EDITING Regex Find & Replace foo[^\[:alpha:\]] causes Writer to become unresponsive
Summary: EDITING Regex Find & Replace foo[^\[:alpha:\]] causes Writer to become unresp...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: All All
: medium major
Assignee: Eike Rathke
URL:
Whiteboard:
Keywords: needsDevEval, topicUI
Depends on:
Blocks:
 
Reported: 2011-10-12 19:49 UTC by Chris Peñalver
Modified: 2015-12-16 05:35 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Peñalver 2011-10-12 19:49:55 UTC
Downstream bug may be found at:

https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/669849

1) lsb_release -rd
Description: Ubuntu 11.10
Release: 11.10

2) apt-cache policy libreoffice-writer
libreoffice-writer:
  Installed: 1:3.4.3-3ubuntu2
  Candidate: 1:3.4.3-3ubuntu2
  Version table:
 *** 1:3.4.3-3ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ oneiric/main i386 Packages
        100 /var/lib/dpkg/status

3) What is expected to happen in LibreOffice Writer via the Terminal:

cd ~/Desktop && lowriter -nologo

Ctrl+F -> Search bar box foo[^\[:alpha:\]] -> click More Options button -> checked Regular expressions checkbox -> clicked Find button

and it fails quickly and gracefully.

4) What happens instead is Writer becomes and remains unresponsive.
Comment 1 Rainer Bielefeld Retired 2011-10-12 23:52:19 UTC
[Reproducible] with Server installation of Master "LibO-dev 3.5.0 – WIN7 Home Premium (64bit) English UI [(Build ID:  d3d1481-3f8994a-2ba0a9f)]" (110909)

Also [Reproducible] with "LibreOffice 3.4.3  - WIN7 Home Premium (64bit) German UI [OOO340m1 (Build:302)]" CALC
Comment 2 Karl Koehler 2011-11-05 22:18:00 UTC
This may be simplified: regex-search for

[[:\]

The following (inline) patch avoids the infinite loop, by advancing the starting point if we fall into the [: a second time. 


--- a/regexp/source/reclass.cxx
+++ b/regexp/source/reclass.cxx
@@ -1255,6 +1255,7 @@ Regexpr::regex_compile()
         break;
       } else {
         p = p1+1;
+        p1 ++;
         last_char = (sal_Unicode)':';
         set_list_bit(last_char, b);
       }
Comment 4 Robinson Tryon (qubit) 2015-12-16 05:35:39 UTC
Migrating Whiteboard tags to Keywords: (ProposedEasyHack ->  needsDevEval, TopicUI)
[NinjaEdit]