Download it now!
Bug 101083 - Insert SVG causes LibreOffice to hang, consuming 100% cpu
Summary: Insert SVG causes LibreOffice to hang, consuming 100% cpu
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
(earliest affected) release
Hardware: All All
: medium major
Assignee: Not Assigned
Keywords: bibisected, filter:svg, regression
: 58420 (view as bug list)
Depends on:
Blocks: SVG-Import
  Show dependency treegraph
Reported: 2016-07-23 10:40 UTC by librereporter
Modified: 2020-06-20 20:32 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:

SVG that will cause LibreOffice to hang (230.40 KB, image/svg+xml)
2016-07-23 10:40 UTC, librereporter
simplifier sample (572 bytes, image/svg+xml)
2016-10-10 19:12 UTC, Xisco Faulí

Note You need to log in before you can comment on or make changes to this bug.
Description librereporter 2016-07-23 10:40:28 UTC
Created attachment 126372 [details]
SVG that will cause LibreOffice to hang

Attempting to import the attached SVG causes all Libre Office components I've tried (Writer, Draw and Impress) to hang, consuming 100% cpu.

This SVG was generated from:
1) A Grace ( graph that was saved as a PDF
2) Opening that PDF with Inkscape and saving it as an SVG

To reproduce:
1) Open {Writer,Impress,Draw,...}
2) Select "Insert Image"
3) Select the attached SVG

That's it - Libre Office then consumes 100% cpu and doesn't leave the file picker dialog.

Using Ubuntu 16.04 on x86_64.
Comment 1 MM 2016-07-23 11:37:11 UTC
Confirmed with v5.1.5.1 under windows 7 x64.
Confirmed with v5.2.0.3 under ubuntu 16.04 x64.
Comment 2 V Stuart Foote 2016-07-23 16:15:07 UTC
The old filter does open it into Draw, but with terrible font metrics--text extends out of the canvas. But the newer svgio filter chokes on it--so maybe another issue with fill pattern as we've seen before.

The SVG opens quickly into Inkscape and Firefox, and on save from Inkscape as "simple SVG" there is no improvement in attempting to insert the image (i.e. svgio filter) still chokes.

On Windows 10 Pro 64-bit en-US with
Build ID: 9dc3356f1499a2b90078be86ca7470eb2e96aba8
CPU Threads: 8; OS Version: Windows 6.19; UI Render: GL; 
TinderBox: Win-x86@39, Branch:master, Time: 2016-07-21_23:52:45
Locale: en-US (en_US); Calc: CL
Comment 3 Aron Budea 2016-08-06 04:06:57 UTC
The hang started between and, so that part is a regression.

However, the SVG never looked correct, so I'm not sure comparing the two versions would get anywhere. In some releases it looked a bit better, in others worse (the text with terrible font metrics is a new addition in 5.2).
Comment 4 Xisco Faulí 2016-10-10 19:12:26 UTC
Created attachment 127932 [details]
simplifier sample

I've investigated this issue a bit and the problem comes when the element pattern is something like patternTransform="scale(0.00163399,0.00163399)". However, it doesn't hang when it's like patternTransform="rotate(35)". Attaching a simplifier sample
Comment 6 Xisco Faulí 2017-09-14 10:41:08 UTC
*** Bug 58420 has been marked as a duplicate of this bug. ***
Comment 7 Xisco Faulí 2017-09-14 10:44:41 UTC Comment hidden (obsolete)
Comment 8 Noel Grandin 2018-03-26 11:30:26 UTC Comment hidden (obsolete)
Comment 9 MM 2018-05-12 11:24:07 UTC Comment hidden (obsolete)
Comment 10 Aron Budea 2018-05-13 13:33:13 UTC
Not fixed for me (LO hangs), tested with latest commit of bibisect-win32-6.1 as of today (ac27f4e7abf5339f71d4f5f3fc09a13b25669fe4) in Windows 7.
Comment 11 Regina Henschel 2018-05-13 16:54:46 UTC
Not fixed for me with Version: (x64)
Build-ID: 439f17c5cf43b38092b1b834bb006420220262e1
CPU-Threads: 8; BS: Windows 10.0; UI-Render: GL; 
Gebietsschema: de-DE (de_DE); Calc: CL

The problem is the patternTransform attribute in the <pattern> element. If I set the scaling factor to 0.163399, there are no problems. With scaling factor 0.0163399 I get high computer workload, but in the end it is rendered and on high zoom the circles are visible.

factor 0.163399 means about 30×30=900 circles to be rendered.
factor 0.0163399 means about 300×300=90000 circles to be rendered.
factor 0.00163399 as in the attached "simplifier sample" file means about 3000×3000=9000000 circles to be rendered.

I think, there need to be a cut, so that if the to be drawn circle becomes smaller then a threshold, it is no longer drawn as circle. Ersatz might be solid filling with a color with transparency, which considers the percentage of the filled area.

I cannot confirm, that it worked before version 3.6. In version LibreOffice Build ID: dc9775d-05ecbee-0851ad3-1586698-727bf66 the graphic is not rendered at all.
Comment 12 QA Administrators 2019-05-14 02:58:29 UTC Comment hidden (obsolete)
Comment 13 Timur 2019-11-22 14:53:00 UTC
Repro Lo 6.5+
Comment 14 paulystefan 2020-06-20 20:32:22 UTC
Repro Lo beta2
Comment 15 paulystefan 2020-06-20 20:32:34 UTC Comment hidden (obsolete)