godotengine / godotengine/godot
[3.x] Scaling in windowed mode can crash the Linux Operating System
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Reproducible in the Godot 3.6.0 release, other versions untested.
### System information
OS: Linux Mint 22 Cinnamon GPU: Intel Corporation Alder Lake-UP3 GT2 [UHD Graphics] CPU: 12th Gen Intel© Core™ i5-1235U × 10
### Issue description
Viewports can cause the OS to slow down under certain circumstances, eventually freezing and/or crashing the entire OS and potentially corrupting the open project as a result.
I have not tested this on other operating systems or hardware, nor have I tested to see if there are other steps that can be taken to reproduce the issue.
### Steps to reproduce
1. Create an AspectRatioContainer with a typical 3D Viewport setup as its child.
2. Set AspectRatioContainer.ratio to 1.7778 and AspectRatioContainer.stretch mode to STRETCH_COVER (or anything besides STRETCH_FIT).
3. Set "display/window/stretch/mode" to 2d and "display/window/stretch/aspect" to Expand.
4. Launch the project in windowed mode, then scale the window as thin as you can and start moving it around. After a few seconds of slowing down the computer (most obvious when listening to audio) it will begin to freeze and then crash after about 5-10 seconds.
You can skip to step 4 when using the MRP.
### Minimal reproduction project (MRP)
[Viewport Crash.zip](https://github.com/user-attachments/files/18305837/Viewport.Crash.zip)
Contributor guide
Research direction
Start with the attached Viewport Crash.zip minimal reproduction project and follow the four listed steps using windowed mode, 2D stretch, Expand aspect, and STRETCH_COVER. Investigate the viewport and window-scaling behavior while reproducing the slowdown and freeze on Linux. Done means resizing and moving the thin window no longer causes severe system slowdown, freezing, or an operating-system crash.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, godot, linux
- Domain
- computer-graphics, operating-systems, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100