godotengine / godotengine/godot

Certain Control node layout configuration crashes the engine

Open
#116,303 2 comments 1 reaction 0 assignees View on GitHub
bug crash topic:gui
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

Tested to reproduce on at least 4.6-stable, 4.3-stable

### System information

Tested on Ubuntu 24.04 LTS (RTX 4090), MacOS 26 Tahoe (M4 Max)

### Issue description

While working on a menu I noticed a Control node configuration that crashes the engine when expanding/collapsing a menu. I made a minimal repro out of it. It reproduces on the official stable build of 4.6. I captured this stacktrace from a dev build:

The "Object was deleted while awaiting a callback." gets spammed to the console a lot.

```
Object was deleted while awaiting a callback.
Object was deleted while awaiting a callback.
Object was deleted while awaiting a callback.
Object was deleted while awaiting a callback.

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.6.stable.custom_build (89cea143987d564363e15d207438530651d943ac)
Dumping the backtrace. Please include this when reporting the bug on: https://github.com/godotengine/godot/issues
mikko@kalevi:~/devaus/godot/bin$ [1] /lib/x86_64-linux-gnu/libc.so.6(+0x45330) [0x760655245330] (??:0)
[2] Callable::get_object() const (/home/mikko/devaus/godot/core/variant/callable.cpp:164)
[3] CallQueue::statistics() (/home/mikko/devaus/godot/core/object/message_queue.cpp:370)
[4] CallQueue::push_callablep(Callable const&, Variant const**, int, bool) (/home/mikko/devaus/godot/core/object/message_queue.cpp:99)
[5] Callable::call_deferredp(Variant const**, int) const (/home/mikko/devaus/godot/core/variant/callable.cpp:41)
[6] void Callable::call_deferred<>() const (/home/mikko/devaus/godot/core/variant/callable.h:84)
[7] Container::queue_sort() (/home/mikko/devaus/godot/scene/gui/container.cpp:139 (discriminator 2))
[8] Container::_notification(int) (/home/mikko/devaus/godot/scene/gui/container.cpp:197)
[9] Container::_notification_forwardv(int) (/home/mikko/devaus/godot/scene/gui/container.h:36)
[10] BoxContainer::_notification_forwardv(int) (/home/mikko/devaus/godot/scene/gui/box_container.h:36 (discriminator 1))
[11] VBoxContainer::_notification_forwardv(int) (/home/mikko/devaus/godot/scene/gui/box_container.h:89 (discriminator 1))
[12] Object::_notification_forward(int) (/home/mikko/devaus/godot/core/object/object.cpp:1015)
[13] Object::notification(int, bool) (/home/mikko/devaus/godot/core/object/object.h:931)
[14] Control::_size_changed() (/home/mikko/devaus/godot/scene/gui/control.cpp:1816)
[15] Control::set_rect(Rect2 const&) (/home/mikko/devaus/godot/scene/gui/control.cpp:1533)
[16] Container::fit_child_in_rect(RequiredParam, Rect2 const&) (/home/mikko/devaus/godot/scene/gui/container.cpp:126)
[17] BoxContainer::_resort() (/home/mikko/devaus/godot/scene/gui/box_container.cpp:233)
[18] BoxContainer::_notification(int) (/home/mikko/devaus/godot/scene/gui/box_container.cpp:280)
[19] BoxContainer::_notification_forwardv(int) (/home/mikko/devaus/godot/scene/gui/box_container.h:36)
[20] VBoxContainer::_notification_forwardv(int) (/home/mikko/devaus/godot/scene/gui/box_container.h:89 (discriminator 1))
[21] Object::_notification_forward(int) (/home/mikko/devaus/godot/core/object/object.cpp:1015)
[22] Object::notification(int, bool) (/home/mikko/devaus/godot/core/object/object.h:931)
[23] Container::_sort_children() (/home/mikko/devaus/godot/scene/gui/container.cpp:91)
[24] void call_with_variant_args_helper(Container*, void (Container::*)(), Variant const**, Callable::CallError&, IndexSequence<>) (/home/mikko/devaus/godot/core/variant/binder_common.h:228)
[25] void call_with_variant_args(Container*, void (Container::*)(), Variant const**, int, Callable::CallError&) (/home/mikko/devaus/godot/core/variant/binder_common.h:338)
[26] CallableCustomMethodPointer::call(Variant const**, int, Variant&, Callable::CallError&) const (/home/mikko/devaus/godot/core/object/callable_method_pointer.h:107)
[27] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (/home/mikko/devaus/godot/core/variant/callable.cpp:57)
[28] CallQueue::_call_function(Callable const&, Variant const*, int, bool) (/home/mikko/devaus/godot/core/object/message_queue.cpp:221)
[29] CallQueue::flush() (/home/mikko/devaus/godot/core/object/message_queue.cpp:270)
[30] Main::iteration() (/home/mikko/devaus/godot/main/main.cpp:4937)
[31] OS_LinuxBSD::run() (/home/mikko/devaus/godot/platform/linuxbsd/os_linuxbsd.cpp:1002 (discriminator 1))
[32] /home/mikko/devaus/godot/bin/godot.linuxbsd.editor.dev.x86_64(main+0x244) [0x60f933e84660] (/home/mikko/devaus/godot/platform/linuxbsd/godot_linuxbsd.cpp:121)
[33] /lib/x86_64-linux-gnu/libc.so.6(+0x2a1ca) [0x76065522a1ca] (??:0)
[34] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x8b) [0x76065522a28b] (??:0)
[35] /home/mikko/devaus/godot/bin/godot.linuxbsd.editor.dev.x86_64(_start+0x25) [0x60f933e64845] (??:?)
-- END OF C++ BACKTRACE --
================================================================
```

This may be a faulty layout situation or a bad script but if that's the case, I think it should still be gracefully handled by the engine somehow?

### Steps to reproduce

Open and run the attached project. Click "Settings" or "Credits" twice. (ie. try to expand and then collapse the menu)

### Minimal reproduction project (MRP)

[menu-crash-repro.zip](https://github.com/user-attachments/files/25320714/menu-crash-repro.zip)

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.