Bug 104492 - FILEOPEN: Infinite docx loading with 100% CPU usage
Summary: FILEOPEN: Infinite docx loading with 100% CPU usage
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4.5.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.4.0
Keywords: filter:docx, haveBacktrace, perf
: 104491 (view as bug list)
Depends on:
Blocks: DOCX-Opening
  Show dependency treegraph
 
Reported: 2016-12-08 09:29 UTC by Dimitri Bouron
Modified: 2017-03-01 15:08 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
docx file with shape and embedded image (60.11 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2016-12-08 10:10 UTC, Telesto
Details
a backtrace (12.92 KB, text/plain)
2016-12-11 00:19 UTC, fiftyigfuci_f_mi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitri Bouron 2016-12-08 09:29:51 UTC
The attached docx file could not be open.
Document loading is looping and CPU usage takes 100% on one core.

To reproduce this bug, you just have to open 'bug.docx' attached file.

According to console output, this bug is different from tdf#55196 and tdf#96102.

This document has been created with MS Office 2010. It contains arrow shapes and png images.

If you unzip document, you have:

* In bug/word/_rels/document.xml.rels:

[...]
<Relationship Id="rId9" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="media/image1.png"/>
[...]

* In bug/word/document.xml:

[...]
<a:blip r:embed="rId9">
<a:extLst>
<a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}">
<a14:useLocalDpi xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" val="0"/>
</a:ext>
</a:extLst>
</a:blip>
[...]

If you remove images and keep only arrow shapes, file is opening correctly.
I suspect an embedded image bug.

Reproducible on Fedora 24 x86_64
LibreOffice 4.4.5.2, 5.2.2.2, 5.3.0.0.beta1
Comment 1 Xisco Faulí 2016-12-08 10:05:01 UTC
*** Bug 104491 has been marked as a duplicate of this bug. ***
Comment 2 Telesto 2016-12-08 10:10:48 UTC
Created attachment 129392 [details]
docx file with shape and embedded image
Comment 3 Telesto 2016-12-08 10:13:06 UTC
Confirming with:
Version: 5.4.0.0.alpha0+
Build ID: 2bad9f1cd8da0cd3d8ff33e875eaf10c1fd9d0bf
CPU Threads: 4; OS Version: Mac OS X 10.12.1; UI Render: default; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2016-11-29_01:04:44
Locale: nl-NL (nl_NL.UTF-8); Calc: group
Comment 4 Xisco Faulí 2016-12-08 10:15:21 UTC
I tried to measure a roundtrip from command line and I had to stop it after 38 minutes...

time instdir/program/soffice --headless --convert-to docx --outdir /home/xisco/Escriptori/ /home/xisco/Baixades/bug.docx 
convert /home/xisco/Baixades/bug.docx -> /home/xisco/Escriptori//bug.docx using filter : MS Word 2007 XML
^Z
[2]+  Aturat                  instdir/program/soffice --headless --convert-to docx --outdir /home/xisco/Escriptori/ /home/xisco/Baixades/bug.docx

real	38m8.274s
user	0m0.000s
sys	0m0.000s

Confirmed in

Version: 5.4.0.0.alpha0+
Build ID: 7fc84a8e6678e3d0399983f5a078c9b2beb6ee4b
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group
Comment 5 fiftyigfuci_f_mi 2016-12-11 00:19:35 UTC
Created attachment 129476 [details]
a backtrace

LO spits out many of this:
warn:sw.core:5751:1:sw/source/core/text/porlay.cxx:404: SwLineLayout::CalcLine: bad ascent or height

It looks like SwTextFrame::Format consumes a lot of CPU time.

My build:
Version: 5.4.0.0.alpha0+
Build ID: f35d29c8388744be1f95ec4acfca12eec706911a
CPU Threads: 2; OS Version: Linux 4.9; UI Render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); Calc: group
Comment 6 Commit Notification 2017-01-03 12:06:01 UTC
Dimitri Bouron committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=91a176b864ac0492f5c0d2386292118dd3095df4

tdf#104492: Fix bad docx opening and bad layout

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Xisco Faulí 2017-03-01 11:06:35 UTC
Hello Dimitri,
Is this bug fixed?
If so, could you please close it as RESOLVED FIXED?
Comment 8 Dimitri Bouron 2017-03-01 15:08:30 UTC
Hi,

Yes this is fixed. I change the status of the bug.