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: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.1.3.2 release
Hardware: x86-64 (AMD64) All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
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: 2024-09-04 23:41 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


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

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: 5.1.3.2 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,
   http://unifraktur.sourceforge.net/de/maguntia.html)
   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.

Notes:
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:

Version: 5.3.0.0.alpha0+
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)

Version: 5.2.0.0.beta2
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
Version: 7.0.1.2
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
Version: 7.0.3.1
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: 7.1.1.2 / 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: 7.2.0.0.alpha0+ / 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 Comment hidden (obsolete)
Comment 16 Hossein 2024-09-04 23:41:36 UTC
I do not reproduce this issue.

Searching for "t" in the huge document, attachment 125732 [details] finishes in less than 10 seconds and finds 54000 results! This is acceptable.

Even modifying the selection was possible. I tried to make the 54000 selected "t" bold, and it worked fine in a few seconds.

Version: 24.2.2.2 (X86_64) / LibreOffice Community
Build ID: d56cc158d8a96260b836f100ef4b4ef25d6f1a01
CPU threads: 12; OS: Linux 6.2; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded