Bug 125460 - LibreOffice freezes in attempt to open specific docx-file
Summary: LibreOffice freezes in attempt to open specific docx-file
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
Hardware: x86-64 (AMD64) All
: high major
Assignee: Not Assigned
Keywords: bibisected, bisected, perf, regression, wantBacktrace
Depends on:
Blocks: DOCX-Opening
  Show dependency treegraph
Reported: 2019-05-23 13:13 UTC by Cor Nouws
Modified: 2020-09-04 11:06 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:

perf flamegraph (939.26 KB, application/x-bzip)
2019-09-02 17:55 UTC, Julien Nabet

Note You need to log in before you can comment on or make changes to this bug.
Description Cor Nouws 2019-05-23 13:13:29 UTC
take attachment 96245 [details] from bug 76513
try to open in master 63_alpha1
 > freezes.
Try to open in
 > works

Noticed in Version:
Build ID: b26b6cab5d8147d35f76a21c333719c80840d08d
CPU threads: 4; OS: Linux 5.0; UI render: default; VCL: gtk3; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2019-05-20_23:15:15
Locale: nl-NL (nl_NL.UTF-8); UI-Language: en-US
Calc: threaded
Comment 1 Dieter 2019-05-23 13:45:01 UTC
I confirm this

Freezes in

Version: (x64)
Build ID: e92dcfdc7bd7b237e0bee26ff226a102d9e8e766
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-05-14_00:00:57
Locale: en-US (de_DE); UI-Language: en-US
Calc: threaded

Freezes for a while but after 40sec. document can be opened in

Version: (x64)
Build-ID: c838ef25c16710f8838b1faec480ebba495259d0
CPU-Threads: 4; BS: Windows 6.19; UI-Render: GL; 
Gebietsschema: de-DE (de_DE); Calc: CL
Comment 2 artur 2019-06-14 04:03:14 UTC
Regression introduced by: https://gerrit.libreoffice.org/plugins/gitiles/core/+/3272c1eb5563f3bda2caa24f32b1018372622109%5E!/

author	Thorsten Behrens <Thorsten.Behrens@CIB.de>	Mon Oct 01 03:21:59 2018 +0200
committer	Thorsten Behrens <Thorsten.Behrens@CIB.de>	Mon Jan 07 17:49:44 2019 +0100
tree b4b948fd36ed53b1d8399babf2dbe701469da412
parent 5dfd5755c709e91d2903bd7be4582f7832e89780

related tdf#100074: prepare group shapes text input via writerfilter

Bisected with: bibisect-linux64-6.3

Added CC: to Thorsten Behrens

Since this commit the file cannot be opened, but the load bar does do some progress. In the versions that have been reported initially the progress bar does not move at all. Will bibisect again to find that point
Comment 3 artur 2019-06-14 05:30:50 UTC Comment hidden (obsolete)
Comment 4 Xisco Faulí 2019-09-02 15:12:40 UTC
(In reply to artur from comment #3)
> commit that broke the opening of LO completely with the given document.
> Since this commit the progress bar does not even start moving
> https://gerrit.libreoffice.org/plugins/gitiles/core/+/
> 848058625c7fad21e2469c95c2a2078678925a5a%5E!/ 
> author	Noel Grandin <noel.grandin@collabora.co.uk>	Fri May 24 11:49:44 2019
> +0200
> committer	Noel Grandin <noel.grandin@collabora.co.uk>	Fri May 24 14:20:24
> 2019 +0200
> tree 8836a8cd5cb470529bc5609df545da3c138caa25
> use vcl::Timer in StatusIndicatorFactory
> Added CC: to Noel Grandin

Just for the record, the mentioned commit was reverted in https://gerrit.libreoffice.org/plugins/gitiles/core/+/d3b03032b7140a98946bfe8fc475a322e6eb6f9a%5E%21 as it also affected bug 125869
Comment 5 Xisco Faulí 2019-09-02 15:15:10 UTC
Increasing severity...
@Julien, any chance we could get a perf graph?
Comment 6 Julien Nabet 2019-09-02 17:55:24 UTC
Created attachment 153820 [details]
perf flamegraph

Here's a Flamegraph perf on pc Debian x86-64 with master sources updated today.
Comment 7 Noel Grandin 2019-09-04 13:51:46 UTC
The problem (AFAIK) is that the setSize() operation resets rotation, which forces us to restore object rotation, which is very expensive when we are applying rotation to a group object containing tons of sub-objects.

We will probably need a new method setSizeWithoutAffectingRotation(), and plumb it down through the following stack, which will be tricky because svx/ is tricky, and there are UNO interfaces in the way.

#0  SdrTextObj::NbcResize(Point const&, Fraction const&, Fraction const&)  at svx/source/svdraw/svdotxtr.cxx:159

#1  SdrPathObj::NbcResize(Point const&, Fraction const&, Fraction const&) at svx/source/svdraw/svdopath.cxx:2300

#2  SdrObject::Resize(Point const&, Fraction const&, Fraction const&, bool) 
    at svx/source/svdraw/svdobj.cxx:1519

#3  SdrObjGroup::Resize(Point const&, Fraction const&, Fraction const&, bool) 
    at svx/source/svdraw/svdogrp.cxx:613

#4  SdrObjGroup::SetSnapRect(tools::Rectangle const&) at svx/source/svdraw/svdogrp.cxx:521

#5  svx_setLogicRectHack(SdrObject*, tools::Rectangle const&) at svx/source/unodraw/unoshape.cxx:1126

#6  SvxShape::setSize(com::sun::star::awt::Size const&) at svx/source/unodraw/unoshape.cxx:1245

#7  SvxShapeGroup::setSize(com::sun::star::awt::Size const&) at svx/source/unodraw/unoshap2.cxx:167

#8  SwXShape::setSize(com::sun::star::awt::Size const&) at sw/source/core/unocore/unodraw.cxx:2320

#9  writerfilter::dmapper::GraphicImport::lcl_attribute(unsigned int, writerfilter::Value&)
    at writerfilter/source/dmapper/GraphicImport.cxx:766
Comment 8 Xisco Faulí 2020-01-14 10:35:27 UTC
attachment 96245 [details] from bug 76513 is also affected by the same commit
Comment 9 Xisco Faulí 2020-01-14 12:19:35 UTC
Attachment 148656 [details] from bug 122966 is also affected by this issue
Comment 10 NISZ LibreOffice Team 2020-09-03 06:57:19 UTC
No freeze anymore in 

Version: (x64)
Build ID: 8061b3e9204bef6b321a21033174034a5e2ea88e
CPU szálak: 4; OS: Windows 6.3 Build 9600; Felületmegjelenítés: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: CL

6.4.0 was still bad.
Comment 11 NISZ LibreOffice Team 2020-09-03 07:35:51 UTC
No longer freezes for me since:


author	Miklos Vajna <vmiklos@collabora.com>	2020-01-13 20:08:54 +0100
committer	Miklos Vajna <vmiklos@collabora.com>	2020-01-14 08:50:52 +0100

tdf#129516 DOCX import: fix incorrect z-order with textboxes

Thanks Miklos!
Comment 12 Xisco Faulí 2020-09-04 11:06:10 UTC
it takes

real	1m0,631s
user	0m56,852s
sys	0m1,986s


Build ID: 6b2eff7d69c6e14d89dd33eaa58c01d82c541266
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

( the computer is quite slow in general )