ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
15.13k stars 2.25k forks source link

Editor crash when rotating/flipping objects selected by using Ctrl+A and a selection box at the same time #28676

Closed khang06 closed 3 months ago

khang06 commented 3 months ago

Type

Crash to desktop

Bug description

I found this bug with my editor input fuzzer. This is the testcase it spat out, which seems to reliably reproduce the bug for me:

// TestSceneOsuEditor.cs
[Test]
public void TestCrash()
{
    AddStep("InputManager.MoveMouseTo(new Vector2(901.91016f, 207.98755f))", () => InputManager.MoveMouseTo(new Vector2(901.91016f, 207.98755f)));
    AddStep("InputManager.PressButton(MouseButton.Left)", () => InputManager.PressButton(MouseButton.Left));
    AddStep("InputManager.MoveMouseTo(new Vector2(434.76715f, 520.82434f))", () => InputManager.MoveMouseTo(new Vector2(434.76715f, 520.82434f)));
    AddStep("InputManager.PressKey(Key.ControlLeft)", () => InputManager.PressKey(Key.ControlLeft));
    AddStep("InputManager.Key(Key.A)", () => InputManager.Key(Key.A));
    AddStep("InputManager.Key(Key.Comma)", () => InputManager.Key(Key.Comma));
}
NullReferenceException
   at osu.Game.Rulesets.Osu.Objects.Drawables.DrawableOsuHitObject.get_InitialLifetimeOffset() in /home/khangaroo/Github/osu/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs:line 108
   at osu.Game.Rulesets.Osu.Objects.Drawables.DrawableOsuHitObject.<UpdateInitialTransforms>g__applyDim|15_0(Drawable piece) in /home/khangaroo/Github/osu/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs:line 101
   at osu.Game.Rulesets.Osu.Objects.Drawables.DrawableOsuHitObject.<UpdateInitialTransforms>g__applyDimToDrawableHitObject|15_1(DrawableHitObject dho, ArmedState _) in /home/khangaroo/Github/osu/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs:line 105
   at osu.Game.Rulesets.Objects.Drawables.DrawableHitObject.UpdateState(ArmedState newState, Boolean force) in /home/khangaroo/Github/osu/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs:line 492
   at osu.Game.Rulesets.Objects.Drawables.DrawableHitObject.updateStateFromResult() in /home/khangaroo/Github/osu/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs:line 321
   at osu.Game.Rulesets.Objects.Drawables.DrawableHitObject.LoadComplete() in /home/khangaroo/Github/osu/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs:line 231
   at osu.Framework.Graphics.Drawable.loadComplete()
   at osu.Framework.Graphics.Drawable.UpdateSubTree()
   at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
   at osu.Framework.Graphics.Containers.CompositeDrawable.updateChild(Drawable c)
   at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
   at osu.Framework.Graphics.Containers.CompositeDrawable.updateChild(Drawable c)
   ...

It also might be worth mentioning that sometimes, this doesn't immediately crash the game. Instead, the game might crash when seeking to an affected hitobject after doing this.

Screenshots or videos

The video shows me making a selection box, hitting Ctrl+A, then trying to rotate the selection with Ctrl+Comma.

https://github.com/ppy/osu/assets/11239786/451b0d5b-d3d5-4bd9-8df1-75bb254aba96

Version

2024.625.2

Logs

1719685373.auth.log 1719685373.input.log 1719685373.network.log 1719685373.performance.log 1719685373.runtime.log

bdach commented 3 months ago

Looking at sentry, this is essentially a duplicate of https://github.com/ppy/osu/issues/28629