Crash while moving line nodes and zooming in

Bug #1483960 reported by Nick Spurry
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Critical
Unassigned
lib2geom
Fix Committed
Critical
Unassigned

Bug Description

Inkscape repeatedly crashed after performing the same action. I was changing the path of an arrow that had 4 nodes, fine tuning its position. While zooming in and out to using the mouse wheel and pressing CTRL, the Inkscape window disappeared without displaying any errors and with all modifications since last save lost. Error occurred multiple times during the same action, however, I was unable to force it to occur.

OS: Windows 10 x64
Inkscape: 0.91r13725
Locale: English

Revision history for this message
Nick Spurry (nickspurry) wrote :
su_v (suv-lp)
tags: added: crash node-editing
Changed in inkscape:
importance: Undecided → High
Revision history for this message
jazzynico (jazzynico) wrote :

Reproduced on Xubuntu 15.04 after 10 minutes playing with the nodes and zoom levels with the mouse.
When the crash occurred I was zooming in and out while hovering the left node of the J segment with the node tool.
Unfortunately I can't find consistent steps to reproduce.

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

GDB trace attached.
Lines from 6 to 57127removed (all identical to line 5).

Revision history for this message
jazzynico (jazzynico) wrote :

... tested with trunk rev. 14293.

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

Raising importance - no emergency file created (loss of data).

Changed in inkscape:
importance: High → Critical
status: Confirmed → Triaged
Revision history for this message
Mingye Wang (artoria2e5) wrote :

Horrible recursions in lib2geom at https://bazaar.launchpad.net/~lib2geom-hackers/lib2geom/trunk/view/head:/src/2geom/bezier-curve.cpp#L483.

This might be an effective fix (too lazy to get the full source):

--- /tmp/bezier-curve.cpp 2015-11-29 21:09:35.115705600 -0500
+++ /tmp/bezier-curve2.cpp 2015-11-29 21:10:59.503905100 -0500
@@ -469,7 +469,7 @@
     Coord lower = distance(a0, a3);
     Coord upper = distance(a0, a1) + distance(a1, a2) + distance(a2, a3);

- if (upper - lower < 2*tolerance) return (lower + upper)/2;
+ if (upper - lower <= 2*tolerance) return (lower + upper)/2;

     Point // Casteljau subdivision
         // b0 = a0,
--

Or we can check for our terrible tolerance == 0 case:

--- /tmp/bezier-curve.cpp 2015-11-29 21:09:35.115705600 -0500
+++ /tmp/bezier-curve2.cpp 2015-11-29 21:14:50.323817300 -0500
@@ -469,7 +469,7 @@
     Coord lower = distance(a0, a3);
     Coord upper = distance(a0, a1) + distance(a1, a2) + distance(a2, a3);

- if (upper - lower < 2*tolerance) return (lower + upper)/2;
+ if (upper - lower < 2*tolerance || tolerance == 0.0) return (lower + upper)/2;

     Point // Casteljau subdivision
         // b0 = a0,

Revision history for this message
Mingye Wang (artoria2e5) wrote :

Ah, forget about tolerance == 0.0. That's just a mistake from a, uh, heat-oppressed brain.

jazzynico (jazzynico)
tags: added: 2geom
Revision history for this message
Mc (mc...) wrote :

Maybe just some

"tolerance = max(tolerance, 1e-10)" check at the beginning ?

Revision history for this message
Krzysztof Kosinski (tweenk) wrote :

Fixed in 2geom r2483, I added a limit to 8 levels of recursion.

Changed in lib2geom:
status: New → Fix Released
status: Fix Released → Fix Committed
importance: Undecided → Critical
Revision history for this message
Olof Bjarnason (objarni) wrote :

This applies to Inkscape too

Changed in inkscape:
status: Triaged → Fix Committed
jazzynico (jazzynico)
Changed in inkscape:
milestone: none → 0.92
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.