unbounded recursion with markers in a stylesheet

Bug #261786 reported by Allison Karlitskaya
2
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
Martin Owens

Bug Description

inkscape:
  Installed: 0.46-0ubuntu2
(ubuntu hardy)

this document crashes inkscape due to an unbounded recursion:

<?xml version='1.0'?>

<svg xmlns='http://www.w3.org/2000/svg'>
  <style type='text/css'>
    path
    {
      marker-start: url(#ouch);
    }
  </style>
  <marker id='ouch'>
    <path d='M 0 0 V 4'/>
  </marker>

  <path d='M 0 0 V 4'/>
</svg>

i'm guessing the infinite recursion is caused by the fact that the stylesheet is trying to apply the marker to the path statement in the marker itself....

Tags: crash
tags: added: crash
Revision history for this message
su_v (suv-lp) wrote :

reproduced with Inkscape 0.47+devel r9096 on OS X 10.5.8

Changed in inkscape:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
su_v (suv-lp) wrote :
Revision history for this message
Martin Owens (doctormo) wrote :

I tracked through the infinite loop. The first problem is that the style sets a shape which is tries to render infinitely:

sp_shape.cpp:828 sp_shape_update_marker_view (shape, s);

 If that's dealt with it loops forever on bbox calculation because markers add to the bbox too.

sp_shape.cpp:545 bbox |= marker_item->visualBounds(tr);

So, that's just a rabbit hole. Instead I attacked the Shape->hasMarkers() with a simple for each parent, if parent is marker, this shape has no markers logic. This means we do not allow marker children to have markers. But it fixes this bug and I don't mind the restriction.

Changed in inkscape:
status: Confirmed → Fix Committed
assignee: nobody → Martin Owens (doctormo)
Revision history for this message
su_v (suv-lp) wrote :

Martin Owens updated bug status:
> status: Confirmed → Fix Committed

r12372

Changed in inkscape:
milestone: none → 0.49
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.