Bug 64216 - Writer takes several minutes of 100% CPU to open or display a simple ODT with frames
Summary: Writer takes several minutes of 100% CPU to open or display a simple ODT with...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.2.0
Keywords: perf
Depends on:
Blocks: CPU-AT-100%
  Show dependency treegraph
 
Reported: 2013-05-04 16:15 UTC by Tristan Miller
Modified: 2021-08-25 18:17 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
A simple ODT which LibreOffice takes too long to open and process (23.04 KB, application/vnd.oasis.opendocument.text)
2013-05-04 16:15 UTC, Tristan Miller
Details
Sample file after deleting text box. (18.74 KB, application/vnd.oasis.opendocument.text)
2013-05-04 17:15 UTC, m_a_riosv
Details
Perfgraph here (3.99 MB, image/svg+xml)
2020-12-22 07:45 UTC, Roman Kuznetsov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tristan Miller 2013-05-04 16:15:23 UTC
Created attachment 78849 [details]
A simple ODT which LibreOffice takes too long to open and process

The attached ODT was produced by LibreOffice Writer 4.0.2 and is a simple two-page document containing nothing but unformatted text and some automatically hyperlinked URLs.

However, trying to open this document (using the same system) takes about five minutes, during which time LibreOffice Writer uses nearly 100% of the CPU.  After the document is open, then even simple activities such as resizing the LibreOffice Writer window cause a similar delay.

I can also reproduce this problem on another x86-64 GNU/Linux system with an earlier version of LibreOffice (3.5).
Comment 1 m_a_riosv 2013-05-04 17:15:44 UTC
Created attachment 78853 [details]
Sample file after deleting text box.

Hi Tristan,
seems the issue is with the text box, after deleting it the issue is gone.

The text boxes are there for any reason?, I have not seen nothing different after deleting it.

To see what is in the file you can use the navigator F5.
Comment 2 Jorendc 2013-05-04 17:37:56 UTC
(In reply to comment #1)
> Created attachment 78853 [details]
> Sample file after deleting text box.
> 
> Hi Tristan,
> seems the issue is with the text box, after deleting it the issue is gone.

Nice catch!

> The text boxes are there for any reason?, I have not seen nothing different
> after deleting it.

Still ... LibreOffice shouldn't loop/freeze for such a long time (and in particular not with our own file format odt). I hope you agree?

Therefore I'm going to mark this bug as NEW.

While opening I keep getting this warning in my terminal:

warn:legacy.osl:6824:1:sw/source/core/layout/calcmove.cxx:1397: debug assertion: <SwCntntFrm::MakeAll()> - format of text frame suppressed by fix b6448963

Kind regards,
Joren
Comment 3 Jorendc 2013-05-04 18:29:59 UTC
@Miklos, Michael: Don't know this is only reproducible with this document, or there are other files around that keeps loading/looping. Because this is our own file format, I place you both in CC. Thanks for your time!

Kind regards,
Joren
Comment 4 Tristan Miller 2013-05-04 19:47:43 UTC
(In reply to comment #1)
> seems the issue is with the text box, after deleting it the issue is gone.
> 
> The text boxes are there for any reason?, I have not seen nothing different
> after deleting it.

I didn't notice any text boxes; they certainly weren't entered deliberately.  A friend of mine produced this file by manual typing, and in some cases by copying and pasting text from a web browser.  So I assume any text boxes must have been automatically created by LibreOffice when rich text or HTML was copied and pasted.
Comment 5 Gerry 2013-05-05 21:35:49 UTC
I could reproduce the problem in LO 3.6.2.2 and 4.0.0.3 on Ubuntu 12.10.
Comment 6 QA Administrators 2015-03-04 02:19:24 UTC Comment hidden (obsolete)
Comment 7 Tristan Miller 2015-03-04 07:55:22 UTC
Still reproducible using LibreOffice 4.4.1.2 on openSUSE 13.2 (x86-64).
Comment 8 Jean-Baptiste Faure 2015-03-15 21:46:52 UTC
There is 3 text boxes in the document and each text box contains long text in Cyrillic characters andseams to be anchored to the page but outside the page and with a very small size. You can check that by opening the file with your preferred unzipper software and by editing the content.xml with your preferred text editor.
Not sure if this file is a valid ODF document.

Best regards. JBF
Comment 9 Tristan Miller 2015-03-16 09:41:53 UTC
(In reply to Jean-Baptiste Faure from comment #8)
> Not sure if this file is a valid ODF document.

The ODF validator at http://odf-validator.rhcloud.com/ claims it's not a conformant ODF 1.2 document.  However, all the errors it flagged are from unexpected attributes, not from the placement of text or elements.

Even if the ODF is invalid, this is still a LibreOffice bug, since the document was produced using LibreOffice Writer 4.0.2.  Unfortunately, by now I don't remember the exact series of steps used to produce this document.  As I mentioned before, though, it involved only manual typing plus some copying and pasting formatted text from a web browser.
Comment 10 Jean-Baptiste Faure 2015-03-16 09:59:46 UTC
(In reply to Tristan Miller from comment #9)
> (In reply to Jean-Baptiste Faure from comment #8)
> > Not sure if this file is a valid ODF document.
> 
> The ODF validator at http://odf-validator.rhcloud.com/ claims it's not a
> conformant ODF 1.2 document.  However, all the errors it flagged are from
> unexpected attributes, not from the placement of text or elements.
> 
> Even if the ODF is invalid, this is still a LibreOffice bug, since the
> document was produced using LibreOffice Writer 4.0.2.  

I agree.

> Unfortunately, by now
> I don't remember the exact series of steps used to produce this document. 
> As I mentioned before, though, it involved only manual typing plus some
> copying and pasting formatted text from a web browser.

From a web browser ? So, the very small frames sound like web bugs for me. You should try to read what is written in these frames. Not sure you want to assume their content.

Best regards. JBF, paranoid. :-)
Comment 11 Tristan Miller 2015-03-16 10:19:56 UTC
Looks like the text has been copied from a forum post at <http://ftour.otzyv.ru/read.php?id=131361#1929261>.  Google Translate shows that it's nothing terribly embarrassing; just a list of sights to see in Innnsbruck.
Comment 12 tommy27 2016-04-16 07:26:21 UTC Comment hidden (obsolete)
Comment 13 Tristan Miller 2016-04-22 10:43:06 UTC
Confirming bug still exists as originally described in LibreOffice 5.1.2.2.0+ (on openSUSE 13.2).
Comment 14 Yousuf Philips (jay) (retired) 2016-10-17 03:12:21 UTC
@Meeks: Should a particular trace be run for this?
Comment 15 Aron Budea 2016-10-17 03:43:34 UTC
This is equally slow in Windows (5.3 master / Windows 7).
Comment 16 QA Administrators 2017-10-23 14:15:01 UTC Comment hidden (obsolete)
Comment 17 Jean-Baptiste Faure 2017-10-28 20:00:11 UTC
Still reproducible with current master. Removing the frames fixes the problem.

Best regards. JBF
Comment 18 QA Administrators 2018-11-07 04:02:29 UTC Comment hidden (obsolete)
Comment 19 Tristan Miller 2018-11-07 09:15:07 UTC
Confirming bug is still reproducible with LibreOffice 6.1.3.1 on openSUSE Tumbleweed.
Comment 20 sdc.blanco 2019-10-30 01:32:25 UTC
Repro:

Version: 6.3.3.1 (x64)
Build ID: f41f4c7f9507aeca13cb9df51f34d80e8ba30a99
CPU threads: 8; OS: Windows 10.0; UI render: default; VCL: win;
Comment 21 Roman Kuznetsov 2020-12-22 07:45:56 UTC
Created attachment 168399 [details]
Perfgraph here
Comment 22 Noel Grandin 2021-08-25 12:15:20 UTC
On current master, this file opens in seconds
Comment 23 Jean-Baptiste Faure 2021-08-25 15:36:29 UTC
(In reply to Noel Grandin from comment #22)
> On current master, this file opens in seconds

Idem in 

Version: 7.2.1.0.0+ / LibreOffice Community
Build ID: 26adaed995097a160063b54a9d2a8d81b34f145d
CPU threads: 8; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Ubuntu_20.04_x86-64
Calc: threaded

but problem still there in

Version: 7.1.7.0.0+ / LibreOffice Community
Build ID: b8b3abc864e81c6ea76043a65ce234ada8651341
CPU threads: 8; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Ubuntu_20.04_x86-64
Calc: threaded

Closing as WorksForMe because we don't know which change solved the problem.

Best regards. JBF
Comment 24 Aron Budea 2021-08-25 18:17:21 UTC
Fixed by the following commit, reverse bibisected using repo bibisect-linux-64-7.2.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=301278b656e76b6f42af5cf8a6f5c6c02acfffeb
author		Miklos Vajna <vmiklos@collabora.com>	2021-05-20 18:02:12 +0200
committer	Miklos Vajna <vmiklos@collabora.com>	2021-05-20 22:38:03 +0200

sw: allow the height of a line to be larger than 65536 twips