Bug 100479 - Searching text in a large document using the "Find all" button makes LibreOffice Writer unresponsive (freeze) for minutes
Summary: Searching text in a large document using the "Find all" button makes LibreOff...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) release
Hardware: x86-64 (AMD64) All
: medium minor
Assignee: Not Assigned
Keywords: perf
: 112799 (view as bug list)
Depends on:
Blocks: Find-Search Performance
  Show dependency treegraph
Reported: 2016-06-19 13:02 UTC by Matthias Basler
Modified: 2023-04-02 03:24 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:

200 page LoremIpsum document with embedded font (9.39 MB, application/vnd.oasis.opendocument.text)
2016-06-19 13:05 UTC, Matthias Basler
Sample document (236.87 KB, application/octet-stream)
2021-03-26 01:14 UTC, Rigoberto Calleja
screnshot of CPU (88.10 KB, image/png)
2021-04-01 21:20 UTC, BogdanB

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Basler 2016-06-19 13:02:08 UTC
User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0
Build Identifier: Version: Build-ID: 644e4637d1d8544fd9f56425bd6cec110e49301b

Using the function "Alle suchen" (engl. "search all" or "find all") on a larger document, e.g. 150+ pages, with certain fonts can make LibreOffice freeze for minutes without the possibility to cancel the process in case the button was inadvertently pressed.

From my user'S POV the issue seems to be not the search itself, but the need to subsequently highlight all found search results, which, depending on the font, can make LibreOffice unresponsive.

Even if LibreOffice is not be responsible for the long rendering time, it should show a better behaviour in this case.

Reproducible: Sometimes

Steps to Reproduce:
1. Create 200p Lorem ipsum document (or open sample)
2. Install "UnifrakturMaguntia" font if necessary (Open Source,
   I tried to embedd the font in the ODT, so this might not be necessary.
3. Set default paragraph style to this font if not yet done.
4. Type Ctrl+F
5. Enter "t " as search and then click on "Search all".
-> Progress bar finishes quickly, but subsequently LO doesn't react any more.

This is 100% reproducible in my document (175 pages of text, partly in Gothic font ("UnifrakturMaguntia"), partly in "normal" Times font. No images, Nothing fancy except for plenty of long "s" as usual in old German texts. 
Searching for, lets say, "s " or "t " freezes the application for 2:45 minutes!

With a plain "Lorem Ipsum" of 200 pages in Times New Roman, searching only takes about 10s (the second part of which LO is not responding too.)

However, if I convert the text to "UnifrakturMaguntia" font, then marking the found letters suddenly takes five minutes too.
Actual Results:  
After searching the document LO freezes for minutes

Expected Results:  
LO remains responsive, shows a progess/busy indicator and allows to cancel the long running operation.

Reset User Profile?No
Comment 1 Matthias Basler 2016-06-19 13:05:35 UTC
Created attachment 125732 [details]
200 page LoremIpsum document with embedded font
Comment 2 Marco Filippozzi 2016-06-20 07:40:32 UTC
Replicated on:

Build ID: e1c435ba88c8ec14145b59398a8a46056f277d4c
CPU Threads: 2; OS Version: Linux 4.1; UI Render: default; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-06-19_23:57:40
Locale: it-IT (it_IT.UTF-8)

Build ID: ae12e6f168ba39f137fc110174a37c482ce68fa4
CPU Threads: 2; OS Version: Linux 4.1; UI Render: default;
Locale: it-IT (it_IT.UTF-8)

OS:    openSUSE Leap 42.1 (x86_64)
Comment 3 QA Administrators 2017-09-01 11:19:23 UTC Comment hidden (obsolete)
Comment 4 QA Administrators 2019-12-03 13:50:04 UTC Comment hidden (obsolete)
Comment 5 BogdanB 2020-09-21 07:26:07 UTC
I replaced the text body font with Liberation Sans, and it is the same thing.
I don't know if it is font related. I think it's search related. 

All the searched terms are in memory and affecting LO. If you click any text canceling the higlight of the search results everything became responsive again.

Tested in
Build ID: 7cbcfc562f6eb6708b5ff7d7397325de9e764452
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-US (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 6 Aron Budea 2021-01-06 07:06:01 UTC
*** Bug 112799 has been marked as a duplicate of this bug. ***
Comment 7 Rigoberto Calleja 2021-03-26 01:14:10 UTC
Created attachment 170744 [details]
Sample document

Sample document.
Comment 8 Rigoberto Calleja 2021-03-26 01:54:34 UTC
Steps to reproduce:
1.- Open Sample Document
2.- Search for "ARTICULO 142"

Actual Results:  
CPU highly loaded and LibreOffice Writer hung for some time before string is found.

Expected Results:
String is found in a few seconds.

This is a deal breaker for users who work with large documents frequently. Is it possible for you to consider revising this bug's importance to reflect that please? 

Tested in
Build ID: 00(Build:1)
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: es-MX (es_MX.UTF-8); Interfaz: es-ES
Ubuntu package version: 1:7.0.3-0ubuntu0.20.10.1
Calc: threaded
Comment 9 Rigoberto Calleja 2021-03-26 02:04:58 UTC
Comment on attachment 170744 [details]
Sample document

Number of words: 142,025
Number of characters: 882,562
Comment 10 Rigoberto Calleja 2021-03-26 02:44:30 UTC
I must add that as long as the "Find Next" button is used instead, this bug is not a deal breaker.
Comment 11 BogdanB 2021-04-01 21:15:39 UTC
I searched for "ARTICULO 142" with Ctrl+F and than Find All. 2 seconds.

Then I searched for "a". A lot of "a", so the one of the fourth CPU that I have have gone to 100% for 20 seconds, than to 8%. And another CPU have gone to 100% for 10 seconds. So a total of 30 seconds of freezing when searching for a lot of "a" in a document with 882.562 characters. I think is quite ok for a such a long document.
Comment 12 BogdanB 2021-04-01 21:15:56 UTC
Tested with
Version: / LibreOffice Community
Build ID: fe0b08f4af1bacafe4c7ecc87ce55bb426164676
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 13 BogdanB 2021-04-01 21:19:25 UTC
Exactly the same result with Version: / LibreOffice Community
Build ID: c088d26578d1be352efa49bd164a8217627648de
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 14 BogdanB 2021-04-01 21:20:00 UTC
Created attachment 170907 [details]
screnshot of CPU
Comment 15 QA Administrators 2023-04-02 03:24:01 UTC
Dear Matthias Basler,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)

If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword

Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team