godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.86k stars 21.14k forks source link

Game crashes when resizing UI to exact size of Container #83789

Open AsperTheDog opened 1 year ago

AsperTheDog commented 1 year ago

Godot version

v4.1.2.stable.official [399c9dc39]

System information

Godot v4.1.2.stable - Windows 10.0.22000 - Vulkan (Compatibility) - NVIDIA GeForce RTX 3070 Ti (NVIDIA; 31.0.15.3758) - Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz (8 Threads)

Issue description

Whenever I resize the game, if the size of the window matches the size of a specific container the whole computer freezes for a moment, then a "message out of memory" error is displayed in the terminal and the game crashes (Infinite loop somewhere that causes a stack overflow?).

https://github.com/godotengine/godot/assets/45227294/eb2f41f7-9343-4d7d-b171-621727bf8d55

Steps to reproduce

  1. Open sample project
  2. Run UI scene (Scenes/UI.tscn)
  3. Slowly shrink window vertically
  4. See how the computer freezes for a moment, then the game becomes unresponsive, then it crashes.

Minimal reproduction project

MRP.zip

KoBeWi commented 1 year ago

This is a known issue, check the description of expand_mode in TextureRect. Avoid using fit modes with AspectRatioContainer.

AsperTheDog commented 1 year ago

I tried removing the AspectRatioContainer and the problem still persists so it probably still breaks either just with the margin container or the panel. Just avoid fit modes in general

bitsawer commented 1 year ago

This could also be related to https://github.com/godotengine/godot/issues/81878. The TextureRect issue is tracked here I think: https://github.com/godotengine/godot/issues/75713 (or https://github.com/godotengine/godot/issues/73071).