ppy / osu

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

Settings/options menu does not load in rare cases #30632

Open spdragon0 opened 3 hours ago

spdragon0 commented 3 hours ago

Type

Game behaviour

Bug description

Settings menu shows loading animation, but nothing happens. Runtime log shows a division by zero exception. This occurred after trying to open the menu using Ctrl-O after about 1 hour of gameplay. Re-opening the menu doesn't work, but restarting the game seems to fix the issue.

Screenshots or videos

No response

Version

2024.1009.1

Logs

1731644629.auth.log 1731644629.database.log 1731644629.nauth.log 1731644629.network.log 1731644629.performance.log 1731644629.runtime.log

smoogipoo commented 2 hours ago
2024-11-15 05:08:03 [error]: An unhandled error has occurred.
2024-11-15 05:08:03 [error]: System.DivideByZeroException: Attempted to divide by zero.
2024-11-15 05:08:03 [error]: at System.Decimal.DecCalc.VarDecDiv(DecCalc& d1, DecCalc& d2)
2024-11-15 05:08:03 [error]: at osu.Framework.Graphics.UserInterface.SliderBar`1.<.ctor>b__12_5(ValueChangedEvent`1 e)
2024-11-15 05:08:03 [error]: at osu.Framework.Bindables.Bindable`1.TriggerValueChange(T previousValue, Bindable`1 source, Boolean propagateToBindings, Boolean bypassChecks)
2024-11-15 05:08:03 [error]: at osu.Framework.Bindables.BindableNumber`1.setValue(T value)
2024-11-15 05:08:03 [error]: at osu.Framework.Bindables.Bindable`1.TriggerValueChange(T previousValue, Bindable`1 source, Boolean propagateToBindings, Boolean bypassChecks)
2024-11-15 05:08:03 [error]: at osu.Framework.Bindables.BindableNumber`1.setValue(T value)
2024-11-15 05:08:03 [error]: at osu.Framework.Bindables.BindableNumber`1.CopyTo(Bindable`1 them)
2024-11-15 05:08:03 [error]: at osu.Framework.Bindables.RangeConstrainedBindable`1.BindTo(Bindable`1 them)
2024-11-15 05:08:03 [error]: at osu.Framework.Graphics.UserInterface.SliderBar`1.set_Current(Bindable`1 value)
2024-11-15 05:08:03 [error]: at osu.Game.Overlays.Settings.SettingsItem`1.set_Current(Bindable`1 value)
2024-11-15 05:08:03 [error]: at osu.Game.Overlays.Settings.Sections.Gameplay.AudioSettings.load(OsuConfigManager config, OsuConfigManager osuConfig)
2024-11-15 05:08:03 [error]: at osu.Game.Overlays.Settings.Sections.Gameplay.AudioSettings.<>c.<RegisterForDependencyActivation>b__3_0(Object t, IReadOnlyDependencyContainer d)

Following the IL, it looks like it's happening here:

https://github.com/ppy/osu-framework/blob/20c0c2ccaae04e28a2648a803c917519b75d7777/osu.Framework/Graphics/UserInterface/SliderBar.cs#L77-L81

Which leads to perhaps this division?

https://github.com/ppy/osu-framework/blob/20c0c2ccaae04e28a2648a803c917519b75d7777/osu.Framework/Bindables/BindableNumber.cs#L82

But I'm not sure why, precision shouldn't be 0 there.

peppy commented 2 hours ago

The only gameplay usage of this bindable is

https://github.com/ppy/osu/blob/ad2cd0ba8fb0b640155a704d2f39069eabec4985/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs#L202

It's binding a Bindable to a BindableNumber which one might argue could break precision in some way? But I can't reproduce no matter what scenario I test with. Unless this happens to more users I feel like this might be a dead end cause to investigate further.