ppy / osu

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

Dragging (selecting) with the mouse while holding down a key in a text box can crash the game #29041

Open Gabixel opened 1 month ago

Gabixel commented 1 month ago

Type

Crash to desktop

Bug description

The video should easily describe the issue. It's not a common thing to do, but it's possible to replace a string in a text box while holding down a letter and dragging with the mouse cursor. This seems to cause a crash in some cases. Not sure of the correct scenario to reproduce this 100%, but it seems easy to do (see the video).

I just tried it in the settings and in the collections dropdown (in the carousel) for now. The video shows the former.

Screenshots or videos

https://github.com/user-attachments/assets/3a92e386-212a-4086-9919-218cbf225318

Version

2024.718.1

Logs

1721844249.runtime.log

Relevant portion:

2024-07-24 18:16:55 [error]: An unhandled error has occurred.
2024-07-24 18:16:55 [error]: System.ArgumentOutOfRangeException: Index and length must refer to a location within the string. (Parameter 'length')
2024-07-24 18:16:55 [error]: at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length)
2024-07-24 18:16:55 [error]: at System.String.Substring(Int32 startIndex, Int32 length)
2024-07-24 18:16:55 [error]: at osu.Framework.Graphics.UserInterface.TextBox.get_SelectedText()
2024-07-24 18:16:55 [error]: at osu.Game.Graphics.UserInterface.OsuTextBox.<>c__DisplayClass35_0.<PlayFeedbackSample>b__0()
2024-07-24 18:16:55 [error]: at osu.Framework.Threading.ScheduledDelegate.RunTaskInternal()
2024-07-24 18:16:55 [error]: at osu.Framework.Threading.Scheduler.Update()
2024-07-24 18:16:55 [error]: at osu.Framework.Graphics.Drawable.UpdateSubTree()
2024-07-24 18:16:55 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
Gabixel commented 1 month ago

I forgot to point out that I have a custom ruleset, as you can see from the video. I just tried without it - just in case - and the problem persists.