Bug 162644 - 100% CPU usage and slow export to PDF when opening document with Writer
Summary: 100% CPU usage and slow export to PDF when opening document with Writer
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.5.2 release
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisectRequest, regression
Depends on:
Blocks: Performance
  Show dependency treegraph
 
Reported: 2024-08-26 15:45 UTC by Marco
Modified: 2024-12-02 06:45 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
The file which causes the issue (11.16 KB, application/vnd.oasis.opendocument.text)
2024-08-26 15:45 UTC, Marco
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marco 2024-08-26 15:45:31 UTC
Description:
Hello,

When I open a specific file with LibreOffice Writer, the CPU usage of a thread quickly jumps to 100% and stays there even if I'm not interacting with the software. 

Additionally, when trying to convert the document to a PDF using the CLI, the process takes around 10 seconds on my machine, for what should be almost instant.

The affected document is very simple, and somehow involves a shape in the header, and you need multiple pages to reproduce it (If you delete all pages but the first one, the usage goes back to normal levels)


Steps to Reproduce:
1. Open the affected document
2. Look at the CPU usage

-- OR --
1. Execute `libreoffice --convert-to pdf slow.odt` (It takes around 10 seconds on my machine)

Actual Results:
The CPU usage is unusually high and the pdf transformation take a long time

Expected Results:
The CPU usage should be significantly lower and the pdf transformation should take less than a second (Which happens if you remove the header)


Reproducible: Always


User Profile Reset: No

Additional Info:
The repro file can be downloaded from here (I don't know how to attach a file: https://walcu-public.s3.eu-west-1.amazonaws.com/slow.odt)
Comment 1 Marco 2024-08-26 15:45:57 UTC
Created attachment 196030 [details]
The file which causes the issue
Comment 2 m_a_riosv 2024-08-26 22:52:52 UTC
Seems the issue is with the shape itself.
In this case, changing the wrap to any of the other options, seems to avoid the issue.

And deleting the shape and adding a new one, also shows no issue wrapping as character.

Reproducible
Version: 24.8.0.3 (X86_64) / LibreOffice Community
Build ID: 0bdf1299c94fe897b119f97f3c613e9dca6be583
CPU threads: 16; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: CL threaded

Opening with 24.2.0.3, looking with the navigator, there are 5 shapes with the same name.

No reproducible.
Version: 6.4.7.2 (x64)
Build ID: 639b8ac485750d5696d7590a72ef1b496725cfb5
CPU threads: 16; OS: Windows 10.0 Build 22631; UI render: GL; VCL: win; 
Locale: es-ES (es_ES); UI-Language: en-US
Calc: CL
Comment 3 BogdanB 2024-10-12 18:47:53 UTC
I was trying to bibisect this with 24.2 with this command:
time ./instdir/program/soffice --convert-to pdf slow.odt

But I always got a 14 seconds time. No regression in 24.2. 

Something like this always in 24.2.
real	0m14,721s
user	0m14,381s
sys	0m0,277s

So, there are 2 possible explanations:
- something changed in the file, like is mentioned in comment 2
- the best working version was NOT 24.2, but an older one. In the Version field of this bug is mentioned version 24.2.5 like the first bad version, that means that the previous version that was working well was 24.2.4. Marco, if you can test an older version that was working well, this info will be much appreciated.
Comment 4 BogdanB 2024-10-12 18:54:02 UTC
By curiosity, I tested your file with 25.2, and I get even worse result, with something around these values:
real	0m15,956s
user	0m15,625s
sys	0m0,217s
Comment 5 danfrantes 2024-12-02 06:45:12 UTC
Hello I will try to profile it with lo 25.2 alpha