crash if Pattern-along-Path LPE applied to path with horizontal line segment (rev >= 14226)

Bug #1482806 reported by su_v
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
Krzysztof Kosinski
lib2geom
Fix Committed
High
Krzysztof Kosinski

Bug Description

Inkscape trunk crashes if a 'Pattern-along-path' LPE is applied to a path with a horizontal (straight) line segment (it makes no difference whether the horizontal segment is at the beginning, end or somewhere in-between other (slanted or curved) line segments of the path.

Steps to reproduce:
1) launch trunk (default new prefs, default new doc)
2) switch to the pen tool, select shape 'Ellipse'
3) draw a path with at least one horizontal straight line segment
--> Inkscape crashes as soon as the path is finished (e.g. with RMB click):

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x000000010038865b in Geom::SBasis::operator[] (this=0x1180bfb70, i=0) at sbasis.h:79
79 return d[i];

Steps to reproduce:
1) launch trunk (default new prefs, default new doc)
2) switch to the star tool, draw a triangle (3 corners),
   use 'Ctrl' so that base line is horizontal (drag vertically)
3) apply 'Pattern along Path' path effect
--> crash

First encountered with Inkscape 0.91+devel r14281 on OS X 10.7.5.

Based on tests with archived builds:
- not reproduced with 0.91+devel rev 14224,
- reproduced with 0.91+devel rev 14228;
this crash is likely related to the recent 2geom update in r14226:
https://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/14226

Possibly related comment: Bug #1473317 comment 5

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

reproduced using the attached demo file. This was made using the first method above, pen tool with shape 'Ellipse'. Upon loading the file I get the attached backtrace.

Program received signal SIGSEGV, Segmentation fault.
0x00432832 in Geom::force_continuity ()
(gdb) bt
#0 0x00432832 in Geom::force_continuity ()
#1 0x00feb7cf in _Unwind_SjLj_Unregister (fc=0x0)
    at ../../../../src/gcc-4.6.1/libgcc/../gcc/unwind.inc:77
#2 0x00000001 in ?? ()
#3 0x0023e1a8 in ?? ()

Changed in inkscape:
status: New → Confirmed
su_v (suv-lp)
Changed in inkscape:
importance: Undecided → High
Revision history for this message
Alvin Penner (apenner) wrote :

attached is a proposed patch for this bug. It involves 2geom, so it will need to be reviewed.

The original code was returning null in the case where you try to take the unary negative of an sbasis which is zero. The new code returns the original zero instead of null.

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

@Alvin - thanks a lot: patch tested successfully with r14293 on OS X 10.7.5 with the test cases described here as well as the one attached in bug #1484009 (didn't take the time to look out for any unexpected side-effects or regressions though).

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

good to hear, thanks for testing. I've posted a question on the 2geom mailing list to see if this type of change is acceptable, since I am a bit out of my depth here.

su_v (suv-lp)
Changed in inkscape:
assignee: nobody → Alvin Penner (apenner)
status: Confirmed → In Progress
Changed in lib2geom:
assignee: nobody → Krzysztof Kosinski (tweenk)
importance: Undecided → High
status: New → Fix Committed
Changed in inkscape:
status: In Progress → Fix Committed
Alvin Penner (apenner)
Changed in inkscape:
assignee: Alvin Penner (apenner) → nobody
Revision history for this message
Krzysztof Kosinski (tweenk) wrote :

Fixed in r14299.

su_v (suv-lp)
Changed in inkscape:
assignee: nobody → Krzysztof Kosinski (tweenk)
Revision history for this message
su_v (suv-lp) wrote :

Follow-up report (regression likely related to changes in r14299):
Bug #1515993 “Hang with CubicBezierSmooth powerstroke interpolator”
https://bugs.launchpad.net/inkscape/+bug/1515993

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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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