Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching tools while dragging a slider control point breaks undo/redo and can crash #30234

Closed
khang06 opened this issue Oct 12, 2024 · 1 comment · Fixed by #30294
Closed
Assignees
Labels
area:editor priority:0 Showstopper. Critical to the next release.

Comments

@khang06
Copy link
Contributor

khang06 commented Oct 12, 2024

Type

Crash to desktop

Bug description

Another input fuzzer find. Switching to another tool via the number keys while dragging a control point leads to some fairly strange behavior.

In the video:

  1. I make a slider
  2. I start dragging one of the control points
  3. I switch to the hitcircle tool without letting go
  4. Undo is now broken
  5. I make a new control point on the slider
  6. I switch to the slider tool without letting go
  7. I hit CTRL+A and move my mouse
  8. Game crashes

The editor crash setup sounds a bit contrived, but I think someone accidentally breaking undo/redo is believable.

Screenshots or videos

crash2remux.mp4

Version

2024.1009.1

Logs

logs.zip

@bdach bdach added the priority:0 Showstopper. Critical to the next release. label Oct 14, 2024
@bdach bdach self-assigned this Oct 14, 2024
@bdach
Copy link
Collaborator

bdach commented Oct 14, 2024

Steps 1 through 4 and 5 through 8 are independent scenarios and do not require one to precede the other.

First one is fixed by

diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs
index 70ccbdfdc4..97b0c84073 100644
--- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs
+++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs
@@ -333,6 +333,9 @@ protected override void Dispose(bool isDisposing)
             base.Dispose(isDisposing);
             foreach (var p in Pieces)
                 p.ControlPoint.Changed -= controlPointChanged;
+
+            if (draggedControlPointIndex >= 0)
+                DragEnded();
         }
 
         private void selectionRequested(PathControlPointPiece<T> piece, MouseButtonEvent e)
@@ -473,7 +480,11 @@ public void DragInProgress(DragEvent e)
             EnsureValidPathTypes();
         }
 
-        public void DragEnded() => changeHandler?.EndChange();
+        public void DragEnded()
+        {
+            changeHandler?.EndChange();
+            draggedControlPointIndex = -1;
+        }
 
         #endregion
 

Still investigating the second one since I'm not super sure what's going on there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:editor priority:0 Showstopper. Critical to the next release.
Projects
None yet
3 participants