2geom infinite loop in bezier root finding

Bug #916171 reported by Gellule on 2012-01-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Undecided
Gellule

Bug Description

This affects trunk @ r10867.

Draw a vertical bezier curve with control points in the same vertical. Switch to select and transform tool. Turn snap to path on. Try to move the curve. Inkscape fezzes in an infinite loop, until memory exhaustion.

The infinite loop is in 2geom's solve_bezier_roots. Further analysis shows that the freeze happens when the input bezier is identically zero (coming from the verticality described above).

The minimum suggested fix would be to look for identically zero bezier at the beginning of this method. It is actually better to look for a constant bezier that also has no roots (provides a minor speed-up in borderline cases).

Gellule (gellule-xg) wrote :

Committed a fix at: http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/10880
Since this is a 2geom change, I also submitted this bug report. I think I remember a requirement to up-port 2geom changes...

Johan Engelen (johanengelen) wrote :

committed to 2geom.
Forwarded it to Nathan who should know whether this is a proper fix. The roots finding has some more bugs.

Gellule (gellule-xg) wrote :

Thanks for the forward, and for making me notice lp:lib2geom.

Johan Engelen (johanengelen) wrote :

Thank you for finding the culprit and posting the fix.
The lib2geom team is small and can use help from smart people :-)

nightrow (jb-benoit) wrote :

Hi,
Seems like you found the solution and the patch is commited.
Do you want to keep this open waiting for a 2geom update, or can we close this as fix commited ?

su_v (suv-lp) wrote :
Changed in inkscape:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers