This file causes a crash when semi circle is moved

Bug #1330295 reported by Martin Owens
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
Liam P. White
lib2geom
Fix Committed
Undecided
Johan Engelen

Bug Description

1:0.48+devel+13418+48~ubuntu14.04.1

Open the attached file and attempt to move one of the semi-circle paths with a black stroke. Inkscape crashes.

It was created by breaking a circle into two halfs using the cut path tool

Revision history for this message
Martin Owens (doctormo) wrote :
Revision history for this message
Liam P. White (liampwhite) wrote :

Confirmed on Windows 7 x64. No usable backtrace as binary was not compiled with debugging symbols.

tags: added: boolops crash
Changed in inkscape:
status: New → Confirmed
Revision history for this message
jazzynico (jazzynico) wrote :

Reproduced on Crunchbang Waldorf, Inkscape trunk revision 13426.
Not reproduced with 0.48.3.1.

Changed in inkscape:
status: Confirmed → Triaged
tags: added: regression
Changed in inkscape:
importance: Undecided → High
milestone: none → 0.91
Revision history for this message
jazzynico (jazzynico) wrote :

GDB trace attached.

tags: added: 2geom
Revision history for this message
Liam P. White (liampwhite) wrote :

I would not chalk this up to a 2geom issue but rather one with libvarot, the "library" that we use mainly for boolops and stroke outlines.

tags: removed: 2geom
Revision history for this message
Martin Owens (doctormo) wrote :

This patch stops the error:

=== modified file 'src/2geom/path.cpp'
--- src/2geom/path.cpp 2014-04-06 21:54:56 +0000
+++ src/2geom/path.cpp 2014-06-19 23:27:23 +0000
@@ -383,7 +383,7 @@
     final_->setPoint(1, c->initialPoint());
   } else {
     if (c->initialPoint() != finalPoint()) {
- THROW_CONTINUITYERROR();
+ return; //THROW_CONTINUITYERROR();
     }
   }
   get_curves().insert(get_curves().end()-1, boost::shared_ptr<Curve>(c));

Basically that throw isn't caught, death to inkscape. No ill effects are experienced with a simple return here. thoughts?

Revision history for this message
Liam P. White (liampwhite) wrote :

@Martin,

Please don't do that — catch the exception in livarot, but please, don't stop it from being thrown. This can make future bugs regarding this situation virtually undetectable since we don't know what causes it.

Revision history for this message
Martin Owens (doctormo) wrote :

Consequence pre-understood. Will have to catch error in livarot, although understanding what is going on is also important. It looks like the order of the end point isn't decoded correctly. Something is wrong with the reading of the svg, so that should be fixed too IMO.

Revision history for this message
Johan Engelen (johanengelen) wrote :

Have not looked at this *at all*, so could be useless but: these continuity exceptions can happen when a curve with a NaN point value is appended to the path. Upon adding, 2geom doesn't throw, but it throws upon applying a transform to a path with NaN points.

Revision history for this message
Liam P. White (liampwhite) wrote :

@~suv:

What revisions might have lead to trunk keeping the "A" in path data longer?

Revision history for this message
Alvin Penner (apenner) wrote :

I am not entirely convinced that line 383 of path.cpp is the source of the problem

- on my machine, Windows XP, Inkscape rev 13470, I have not been able to produce a crash
- however there is something unusual about the svg. The first arc is given by
  M 108.4 12.2 A 4.801 4.801 0 0 1 108.4 12.2
  In svg this type of construction is illegal because the start point of the arc is the same as the endpoint. Hopefully, if all goes well, the parser will ignore this arc entirely. If it does not ignore it, then it will almost certainly lead to a crash, probably a divide by zero. However, the crash will be caused by the fact that two points are the same, not by the fact that they are unequal as tested in line 383.
- The remaining two arcs, after this, look normal: they both represent 90 degree arcs.

Revision history for this message
Liam P. White (liampwhite) wrote :

Fix committed in lp:inkscape, r13492.

Changed in inkscape:
assignee: nobody → Liam P. White (inkscapebrony)
status: Triaged → Fix Committed
Revision history for this message
Liam P. White (liampwhite) wrote :

@Alvin

Thanks for the help in resolving this issue.

tags: added: 2geom
Revision history for this message
Alvin Penner (apenner) wrote :

- no problem, glad to see that it was related to that issue.
- the only thing is, I think this change will need to be applied directly to lib2geom, otherwise it will get overwritten next time a sync is done. perhaps an email to
<email address hidden>
would start the ball rolling

Revision history for this message
Johan Engelen (johanengelen) wrote :

Important information here:
http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes
"If the endpoints (x1, y1) and (x2, y2) are identical, then this is equivalent to omitting the elliptical arc segment entirely."

Revision history for this message
Johan Engelen (johanengelen) wrote :

Committed to lp:lib2geom, r2245

Changed in lib2geom:
assignee: nobody → Johan Engelen (johanengelen)
status: New → Fix Committed
Revision history for this message
Martin Owens (doctormo) wrote :

Anytime we need to upstream: First check if the project is on launchpad or similar service that allows annonimous branches so we can give the upstream the patch directly in code. Second check for bug trackers (for instance libcroco -> Gnome bugzilla) where we can attach a bug patch. And then we can hit up email addresses

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.