godotengine / godotengine/godot

Editor freezes/hangs when selecting Bucket Fill tool in 2D Viewport v4.6 stable

Open
#116,267 5 comments 0 reactions 0 assignees View on GitHub
bug confirmed topic:2d topic:editor
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

> [!NOTE]
> ***Bugsquad edit:*** cleanup up structure and formatting errors

### Tested versions

4.6.stable

### System Information
- **OS:** Windows 11 Home (10.0.26100)
- **CPU:** Intel(R) Core(TM) i7-10750H @ 2.60GHz
- **GPU:** NVIDIA GeForce RTX 2070 / Intel(R) UHD Graphics (Hybrid)
- **Driver:** 32.0.15.8180 (NVIDIA) / 26.20.100.7642 (Intel)
- **RAM:** 15.82 GB

### Issue description

Upon selecting the **Bucket Fill** tool in the TileMap/TileMapLayer editor, the Godot process enters a permanent hang (Not Responding). This occurs immediately upon tool selection, even before interacting with the viewport.

The hang is a **main-thread lock** caused by a high-frequency error loop. When the tool is active, the engine repeatedly attempts to calculate a terrain-aware fill pattern. If the configuration is invalid, it triggers an `ERR_FAIL_COND` which spams the console, saturating the CPU and preventing the UI from processing events.

### Logs (Verbose Output)
When running with `--verbose`, the following error spams the console at an extremely high rate:

```text
ERROR: Condition "p_terrain_set < 0" is true.
at: TerrainsPattern (scene/resources/2d/tile_set.cpp:322)
ERROR: Condition "p_terrain_set < 0" is true.
at: TerrainsPattern (scene/resources/2d/tile_set.cpp:322)
```

Image

### Steps to reproduce

1. Create a new **2D Scene**.
2. Add a **TileMapLayer** node and assign a **TileSet** resource.
3. (Context-specific): This usually occurs when a tile or selection points to a non-existent or deleted **Terrain Set** index.
4. Open the **TileMap editor** bottom panel.
5. Click the **Bucket Fill** tool icon.
6. **Observation:** The cursor freezes and the editor becomes unresponsive.

### Minimal reproduction project (MRP)

I'm unsure how to create an MRP of this issue. Can anyone advise on that ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.