Can't get out from Line/Curve tool

Bug #1429365 reported by Markku Myllymaki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pinta
Invalid
Medium
Unassigned

Bug Description

Summary: I can't change tool from Line/Curve, it throws exception.

This is Pinta 1.6. I work with a really big image with two layers. I tried to test the curve tool to trace a pencil sketch. The curve drawing was very, very slow, but worked until after one curve I couln't get out from the tool. I threw exception whatever I did. I had to kill Pinta to stop.

Here's the exception:
---------------------------------------------

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: SurfaceDiff requires surfaces to be same size.
  at Pinta.Core.SurfaceDiff.Create (Cairo.ImageSurface original, Cairo.ImageSurface updated_surf, Boolean force) [0x00000] in <filename unknown>:0
  at Pinta.Tools.ShapesHistoryItem..ctor (Pinta.Tools.BaseEditEngine passedEE, System.String icon, System.String text, Cairo.ImageSurface passedUserSurface, Pinta.Core.UserLayer passedUserLayer, Int32 passedSelectedPointIndex, Int32 passedSelectedShapeIndex, Boolean passedRedrawEverything) [0x00000] in <filename unknown>:0
  at Pinta.Tools.BaseEditEngine.FinalizeAllShapes () [0x00000] in <filename unknown>:0
  at Pinta.Tools.BaseEditEngine.HandleDeactivated (Pinta.Core.BaseTool newTool) [0x00000] in <filename unknown>:0
  at Pinta.Tools.ShapeTool.OnDeactivated (Pinta.Core.BaseTool newTool) [0x00000] in <filename unknown>:0
  at Pinta.Core.BaseTool.DoDeactivated (Pinta.Core.BaseTool newTool) [0x00000] in <filename unknown>:0
  at Pinta.Core.ToolManager.SetCurrentTool (Pinta.Core.BaseTool tool) [0x00000] in <filename unknown>:0
  at Pinta.Core.ToolManager.HandlePbToolItemClicked (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <filename unknown>:0
  at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0
  at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0
  at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000] in <filename unknown>:0

Revision history for this message
grofaty (grofaty) wrote :

I tried, but I can't reproduce this problem in Pinta development 1.7.0.140 from forge.pinta-project.com on Ubuntu 14.04. Crash didn't appear in my case. It would be helpful if you could write step-by-step instructions how to reproduce a crash. That would be very helpful to diagnose the problem.

But I can reproduce slow responses using some of the tool for bigger images like 5000 x 5000 images. Because of having one problem per bug report I reported new bug for slow performance in bug 1430968.

So this current bug report should only be related to crash and not to slow performance.

Revision history for this message
Markku Myllymaki (markku-m-myllymaki) wrote :

My steps.
My sketch image is 5000x7000. I load it.
I create a new layer.
On that layer I begin to "ink" with Line/Curve tool. Line width can be something between 6 and 20. No aliasing.
After about 20 curves the crash happens.

Memory usage of the mono process has grown from (at start) 300 MB to (just before crash) 1.7 GB, that might have something to do with it. Maybe big image and memory usage for history/undo points together make some unfavorable.

Revision history for this message
Cameron White (cameronwhite91) wrote :

Probably related to bug #776346, but it's really annoying that it keeps throwing exceptions when you try to exit Pinta

Changed in pinta:
importance: Undecided → Medium
milestone: none → 1.7
status: New → Confirmed
Revision history for this message
Markku Myllymaki (markku-m-myllymaki) wrote :

Some progress in 1.7, I can now work longer. Also, drawing feels to be speedier.

However, I was not able to save a big work (throws exception which doesn't go away). I was trying to save in .ora format. That is not acceptable.

Memory is also used very fast. Just some curves and mono process takes over gigabyte of memory.

Some application have possibility to "flatten" Undo-history, so the memory is released from Undo steps. Maybe something like this could be implemented in Pinta? If the user feels that Undo is not necessary (i.e. some part of the work is ready), the user could command Pinta to free Undo memory?

Revision history for this message
Markku Myllymaki (markku-m-myllymaki) wrote :

With latest Pinta 1.7 Ubuntu 12.04 LTS 32-bit version I am able to draw, memory usage is much less and I am able to save and load work with layers intact in ORA file.

Thanks, great work!

Changed in pinta:
status: Confirmed → Fix Released
Revision history for this message
grofaty (grofaty) wrote :

I think status of this bug report is wrong. It should not be "Fix Released" because Pinta 1.7 was not released yet. Probably better "Fix Committed" if we know which commit fixed the problem otherwise it should be marked as Invalid.

Revision history for this message
Cameron White (cameronwhite91) wrote :

Yeah, I'm not sure exactly which commit fixed this.

Changed in pinta:
milestone: 1.7 → none
status: Fix Released → Invalid
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.