Redo multiple actions and crash appears

Bug #1888954 reported by grofaty
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pinta
Confirmed
Medium
Unassigned

Bug Description

Latest Pinta development 1.7+r1110-202007241840~ubuntu18.04.1:

1. New from toolbar and select 4000x4000. Image is properly zoomed in my case 23%.
2. Select Line tool and draw line in upper left corner of canvas.
3. Select Rectangle Select, select small area on canvas of upper left corner so that you select drawn line.
4. Crop to Selection from toobar.
5. Undo from toolbar 3-times. FIRST PROBLEM. Line is way too big, it gets drawn through the full length of canvas.
6. Undo again and we are at the first action in History panel.
7. Now redo 4-times and crash appears. SECOND PROBLEM.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Redo stack is empty
  at Pinta.Core.DocumentWorkspaceHistory.Redo () [0x00019] in <5951116749ed4edeaae59deb464a2fa8>:0
  at Pinta.Core.EditActions.HandlerPintaCoreActionsEditRedoActivated (System.Object sender, System.EventArgs e) [0x0002b] in <5951116749ed4edeaae59deb464a2fa8>:0
  at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
  at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <a17fa1457c5d44f2885ac746c1764ea5>:0
   --- End of inner exception stack trace ---
  at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00083] in <a17fa1457c5d44f2885ac746c1764ea5>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <a17fa1457c5d44f2885ac746c1764ea5>:0
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000e7] in <a17fa1457c5d44f2885ac746c1764ea5>:0
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00008] in <a17fa1457c5d44f2885ac746c1764ea5>:0
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <a17fa1457c5d44f2885ac746c1764ea5>:0
  at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x0007d] in <ed39f21b9e9343dcbd442a17ad356a9f>:0
  at GLib.Signal+SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x0000c] in <ed39f21b9e9343dcbd442a17ad356a9f>:0
  at GLib.Signal+SignalClosure.MarshalCallback (System.IntPtr raw_closure, GLib.Value* return_val, System.UInt32 n_param_vals, GLib.Value* param_values, System.IntPtr invocation_hint, System.IntPtr marshal_data) [0x00050] in <ed39f21b9e9343dcbd442a17ad356a9f>:0

Tags: line-tool
Revision history for this message
grofaty (grofaty) wrote :

I have tested this problem today with the same version, and I see I am unable to produce crash every time I test, but few times random way of undo and redo and crash does appear.

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

I haven't reproduced the crash yet, but I can reproduce the behaviour in step 5 which is still a bug.

Changed in pinta:
importance: Undecided → Medium
status: New → Confirmed
tags: added: line-tool
Revision history for this message
grofaty (grofaty) wrote :

I have tested this problem multiple times and now I am confident that I can ALWAYS reproduce a crash, but now I see it is extremely important how step 2 is performed.

If I start rectangle selecting (as step 2) in the middle of canvas and pull up to the left-top edge, crash never appears.

But if I start rectangle selecting (as step 2) in the top-left OUT OF CANVAS and continue down-right to the canvas crash ALWAYS appears.

One more note. In step 1, I can never produce a crash with 640x480 image, but always with 4000x4000 as noted in original problem report.

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

Hmm, I still couldn't reproduce it with starting the selction in the top-left, although I do now reliably get the display issue from step 5 (also similar to bug 1888899)

Revision history for this message
grofaty (grofaty) wrote :

In 1.7+r1113-202007280014~ubuntu18.04.1 I can't always reproduce the problem, but clicking undo and redo few times and crash appears.

I have recorded video to present this problem. See attachment.

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

Thanks, I was able to reproduce it a couple times now, although it's still hard to make it happen every time.

Revision history for this message
grofaty (grofaty) wrote :

Now I have completely new steps to get into "Redo stack is empty" crash, but this time I have reproducible steps:

Pinta 1.8-dev on Ubuntu 20.04:
https://github.com/PintaProject/Pinta/actions/runs/472957944

1. New Image 800 x 600.
2. Ellipse Select and draw selection on canvas.
3. Ctrl+Shift+X to crop to selection.
4. Press Ctrl+Z to undo last action.
5. Press Ctrl+Y and hold for e.g. two seconds (don't press and reselase, press and hold!). The application crashes:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.InvalidOperationException: Redo stack is empty
   at Pinta.Core.DocumentHistory.Redo()
   at Pinta.Core.EditActions.HandlerPintaCoreActionsEditRedoActivated(Object sender, EventArgs e)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at GLib.Signal.ClosureInvokedCB(Object o, ClosureInvokedArgs args)
   at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)

Also reproducible in Pinta 1.7 snap package on Ubuntu 20.04.

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

Confirmed, I can reproduce it with those steps.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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