Crash with circular reference in the defs

Bug #179582 reported by Luciano Montanaro
6
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
Mc

Bug Description

I made the svg file at http://www.cirulla.net/listing/kde_stuff/tigullio-international-opt6.svg
by inserting inkscape generated images as groups in the defs section, and using those to compose a card deck usable by kpat.

The deck works in kpat, and I can display it with Qt svg viewer, and with ksvg (although ksvg is very slow and does not render correctly the queen of diamonds, for some reason).

Inkscape 0.44 had problems with my use of the defs section, and rendered the cards only partially.
Inkscape 0.45 however cannot load the file. The program keeps the cpu busy, with an always increasing memory use.

Maybe my file is a wrongly formatted svg file, but it should not break inkscape...

Tags: crash svg
Revision history for this message
prkos (prkos) wrote :

I can confirm that the latest dev build on WinXP can't open this file (and becomes unresponsive if trying to open when Inkscape is up).

Processor was burdened and memory usage increased steadily, I ended it when it came close to eat it all up on my machine.

Have you ran it through a svg validator?

Revision history for this message
nightrow (jb-benoit) wrote :

i have run it trough http://validator.w3.org/check
It seems that the file have : "Failed validation, 140 Errors"

I don't think that inkscape have to open it correcly, but it should at least not crash when trying to open it

Changed in inkscape:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Luciano Montanaro (mikelima) wrote :

Thanks to the pointer to the validator, I have tried another one but it did not work.
I have cleaned up the errors and I have a version of the file that displays correctly in inkview.
There were a few duplicate group ids in the file, but that was not really the problem.
I think the problem was due to the fact that group g6633 contained a <use> with an href to itself, so the group referenced itself recursively.

Revision history for this message
leona (leona-simasima) wrote :

Inkscape and Inkview cannot display the attached file properly.
The file is generated by "gnuplot" as a graph of y=sin(x), and no errors are found by http://validator.w3.org/ .

"gqview" and "eye of gnome" can show this graph, but Inkscape shows only letters in graph legend and in XY-axes.

OS: Ubuntu Hardy Heron
Inkscape: Version 0.46

Revision history for this message
leona (leona-simasima) wrote :

Revision 18708 from svn repository works well for me.

Revision history for this message
bbyak (buliabyak) wrote :

confirmed, rev 19232, no paths are seen in Inkscape but Batik shows them ok

Revision history for this message
Lee Olson (leeolson) wrote :

I can also confirm this with Inkscape 0.46, built Nov 23 2008. Inkscape hangs when simply selecting the tigullio-international-opt6.svg file from the "select file to open" dialog.

@Luciano: The issue with the tigullio-international-opt6.svg file can be resolved by modifying line 1718 and replacing:

<use width="206" with <g width="206"

@leona: This should probably be filed as a separate bug. The issue with the sinx.svg file can be resolved by modifying line 103 and replacing:

<g style="fill:none; color:red; stroke:currentColor; stroke-width:1.00; stroke-linecap:butt; stroke-linejoin:miter">

with:

<g style="fill:none; color:red; stroke:#ff0000; stroke-width:1.00; stroke-linecap:butt; stroke-linejoin:miter; stroke-opacity:1">

and modifying line 118 and replacing:

<g style="fill:none; color:black; stroke:currentColor; stroke-width:1.00; stroke-linecap:butt; stroke-linejoin:miter">

with:

<g style="fill:none; color:black; stroke:#000000; stroke-width:1.00; stroke-linecap:butt; stroke-linejoin:miter; stroke-opacity:1">

These are only workarounds to resolve these specific cases, Inkscape needs to check for these types of instances so: 1) it doesn't hang when opening a file with a <use width instead of the <g width
2) the stoke does not use "currentColor" but instead the correct #000000 color, and provides a stroke-opacity:1 so the lines are visible.

Attached are the fixed files.

Revision history for this message
Lee Olson (leeolson) wrote :
Revision history for this message
Luciano Montanaro (mikelima) wrote :

@lee:
I know the file is bad; I've since fixed the file I use (and I've pointed to the problem myself), but my point was rather that inkscape should not hang on bad files, that is, it should notice circular references and bail out/refuse to parse the file further. Just checking if a reference is made to an ancestor of the node should suffice to detect the problem.

Revision history for this message
theAdib (theadib) wrote :

Hello, I tested the two files provided (inkscape can not... and tigullio...) and at least Inkscape continues and renders those files. Please double check! Adib.

Revision history for this message
leona (leona-simasima) wrote :

Hi, I've almost forgotten about this bug.

@theAdib:
Inkscape 0.46 on Ubuntu 9.04 still fails to render the sinx.svg which I post on 2008-05-23.
The symptom is same as before: no lines but only letters are rendered.

@Lee Oison:
Your workaround is useful for me, thanks.
Let me post my problem as a separate bug, if the forthcoming Inkscape 0.47 still fails to render the sinx.svg.

Revision history for this message
theAdib (theadib) wrote :

leona, of course the Ubuntu 9.04 inkscape 0.46 will render as the old one. In order to see the improvement you need to test using inkscape-development version.
Attached screenshots of opening using 0.46 and a recent version of the development version.

Revision history for this message
theAdib (theadib) wrote :
jazzynico (jazzynico)
tags: added: svg
tags: added: crash
Revision history for this message
theAdib (theadib) wrote :

works for me on Linux and Inkscape-pre3 also works for me on Win32.

Please close this issue. Adib.

Revision history for this message
su_v (suv-lp) wrote :

1) not sure about the initial reported problem: Inkscape should notice circular references and bail out/refuse to parse the file further (the original file is no longer available to test against current builds)
2) the currentColor issue (sinx.svg) is a duplicate of bug #174720 (Status "Fix Released")

Revision history for this message
jazzynico (jazzynico) wrote :

Initial issue still unfixed in r10760.
The file never loads and Inkscape crashes after a while (and when memory usage is too high).

Original document (with circular reference) attached.?field.comment=Initial issue still unfixed in r10760.
The file never loads and Inkscape crashes after a while (and when memory usage is too high).

Original document (with circular reference) attached.

Revision history for this message
Samuel Chase (samebchase) wrote :

I can confirm that Inkscape (bzr revision: 11133) still crashes when trying to open the file posted by leeolson.

Inkscape takes more and more memory until the RAM is exhausted.
It segfaults soon after that.

Attached is the backtrace.

Revision history for this message
jazzynico (jazzynico) wrote :

Still reproduced with trunk revision 13395.
Minimal test file attached.

summary: - Inkscape/inkview cannot display this svg file
+ Crash with circular reference in the defs
Changed in inkscape:
status: Confirmed → Triaged
Revision history for this message
jazzynico (jazzynico) wrote :
Revision history for this message
Mc (mc...) wrote :

Is this a duplicate of https://bugs.launchpad.net/inkscape/+bug/167247 ? Crashes with circular references (in the defs or elsewhere) should not happen since r14245 (at least those due to <use> elements, cf commit message of r14245)

Revision history for this message
jazzynico (jazzynico) wrote :

Not exactly the same bug, but also fixed by r14245.
Thanks Mc!

Changed in inkscape:
assignee: nobody → Mc (mc...)
milestone: none → 0.92
status: Triaged → Fix Committed
Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.