godot: Project crashes when pressing any key in v4.4-dev6 and when rolling back to v4.4-dev5 (custom editor shortcuts)

Tested versions

  • v4.4.dev.custom_build.0c45ace15
    • Build made to revert the CPU consumption from 4.4-dev5.
  • v4.4-dev6

System information

windows 10, Forward+, GTX 1660, Ryzen 3300x, 16GB RAM

Issue description

If I execute the project and press any keys in the keyboard the project crashes leaving the following trace:

Godot Engine v4.4.dev6.official.1f47e4c4e - https://godotengine.org
Vulkan 1.3.289 - Forward+ - Using Device #0: NVIDIA - NVIDIA GeForce GTX 1660

(Virtual Joystick) The Project Setting 'emulate_mouse_from_touch' should be set to False
(Virtual Joystick) The Project Setting 'emulate_touch_from_mouse' should be set to True

================================================================
CrashHandlerException: Program crashed with signal 11
Engine version: Godot Engine v4.4.dev6.official (1f47e4c4e3a09a422e96880a7918d986dd575a63)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] error(-1): no debug info in PE/COFF executable
[2] error(-1): no debug info in PE/COFF executable
[3] error(-1): no debug info in PE/COFF executable
[4] error(-1): no debug info in PE/COFF executable
[5] error(-1): no debug info in PE/COFF executable
[6] error(-1): no debug info in PE/COFF executable
[7] error(-1): no debug info in PE/COFF executable
[8] error(-1): no debug info in PE/COFF executable
[9] error(-1): no debug info in PE/COFF executable
[10] error(-1): no debug info in PE/COFF executable
[11] error(-1): no debug info in PE/COFF executable
[12] error(-1): no debug info in PE/COFF executable
[13] error(-1): no debug info in PE/COFF executable
[14] error(-1): no debug info in PE/COFF executable
[15] error(-1): no debug info in PE/COFF executable
[16] error(-1): no debug info in PE/COFF executable
[17] error(-1): no debug info in PE/COFF executable
[18] error(-1): no debug info in PE/COFF executable
[19] error(-1): no debug info in PE/COFF executable
[20] error(-1): no debug info in PE/COFF executable
[21] error(-1): no debug info in PE/COFF executable
[22] error(-1): no debug info in PE/COFF executable
[23] error(-1): no debug info in PE/COFF executable
[24] error(-1): no debug info in PE/COFF executable
-- END OF BACKTRACE --
================================================================
Godot Engine v4.4.dev.custom_build.0c45ace15 (2024-11-22 20:54:49 UTC) - https://godotengine.org
Vulkan 1.3.289 - Forward+ - Using Device #0: NVIDIA - NVIDIA GeForce GTX 1660

(Virtual Joystick) The Project Setting 'emulate_mouse_from_touch' should be set to False
(Virtual Joystick) The Project Setting 'emulate_touch_from_mouse' should be set to True
ERROR: 1 RID allocations of type 'class RendererRD::TextureStorage::Texture' were leaked at exit.
ERROR: Parameter "RenderingServer::get_singleton()" is null.
   at: CompressedTexture2D::~CompressedTexture2D (scene\resources\compressed_texture.cpp:464)
ing the bug to the project developer.
[0] <couldn't map PC to fn name>
[1] <couldn't map PC to fn name>
[2] <couldn't map PC to fn name>
[3] <couldn't map PC to fn name>
[4] <couldn't map PC to fn name>
[5] <couldn't map PC to fn name>
[6] <couldn't map PC to fn name>
[7] <couldn't map PC to fn name>
[8] <couldn't map PC to fn name>
[9] <couldn't map PC to fn name>
[10] <couldn't map PC to fn name>
[11] <couldn't map PC to fn name>
[12] <couldn't map PC to fn name>
[13] <couldn't map PC to fn name>
[14] <couldn't map PC to fn name>
[15] <couldn't map PC to fn name>
[16] <couldn't map PC to fn name>
[17] <couldn't map PC to fn name>
[18] <couldn't map PC to fn name>
[19] <couldn't map PC to fn name>
[20] <couldn't map PC to fn name>
[21] <couldn't map PC to fn name>
[22] <couldn't map PC to fn name>
-- END OF BACKTRACE --
================================================================

I was using 4.4-dev5 as I needed a new feature regarding RPCs. I had to go to v4.4.dev.custom_build.0c45ace15 to revert the Clock Syncing changes that were making impossible to work in my project. I then upgraded to 4.4-dev6.

Now, the project crashes even if I go back to v4.4.dev.custom_build.0c45ace15.

I’ve tried deleting the .godot , appdata/local/godot and the appdata/roaming/godot/app_userdata/_project_name_/folder after rolling back to v4.4.dev.custom_build.0c45ace15, but still crashes.

Steps to reproduce

😕

Minimal reproduction project (MRP)

This is happening in my main project.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 26 (12 by maintainers)

Most upvoted comments

Stacktrace for @caioraphael1’s MRP and editor settings from https://github.com/godotengine/godot/issues/100182#issuecomment-2528560604 on Linux in the latest master branch:

#0  Array::size (this=this@entry=0x240) at core/variant/array.cpp:117
#1  0x00000000046fa99b in Shortcut::matches_event (this=this@entry=0x0, p_event=...) at core/input/shortcut.cpp:64
#2  0x0000000003a3cdfd in SceneDebugger::_handle_input (p_event=..., p_shortcut=...) at scene/debugger/scene_debugger.cpp:99
#3  0x0000000003a47b66 in call_with_variant_args_static<Ref<InputEvent> const&, Ref<Shortcut> const&, 0ul, 1ul> (r_error=..., p_args=0x7fffc9babb70, 
    p_method=0x3a3cd10 <SceneDebugger::_handle_input(Ref<InputEvent> const&, Ref<Shortcut> const&)>) at ./core/variant/binder_common.h:778
#4  call_with_variant_args_static<Ref<InputEvent> const&, Ref<Shortcut> const&> (p_argcount=2, r_error=..., p_args=0x7fffc9babb70, 
    p_method=0x3a3cd10 <SceneDebugger::_handle_input(Ref<InputEvent> const&, Ref<Shortcut> const&)>) at ./core/variant/binder_common.h:847
#5  call_with_variant_args_static<Ref<InputEvent> const&, Ref<Shortcut> const&> (r_error=..., p_argcount=<optimized out>, p_args=0x7fffc9babb70, 
    p_method=0x3a3cd10 <SceneDebugger::_handle_input(Ref<InputEvent> const&, Ref<Shortcut> const&)>) at ./core/variant/binder_common.h:833
#6  CallableCustomStaticMethodPointer<void, Ref<InputEvent> const&, Ref<Shortcut> const&>::call (this=<optimized out>, p_arguments=0x7fffc9babb70, p_argcount=<optimized out>, r_return_value=..., 
    r_call_error=...) at ./core/object/callable_method_pointer.h:251
#7  0x00000000047113c4 in CallableCustomBind::call (this=0x496520e0, p_arguments=<optimized out>, p_argcount=1, r_return_value=..., r_call_error=...) at core/variant/callable_bind.cpp:150
#8  0x0000000004a07f3c in Object::emit_signalp (this=<optimized out>, p_name=..., p_args=0x7fffc9babd10, p_argcount=1) at core/object/object.cpp:1200
#9  0x0000000002a8acca in Object::emit_signal<Ref<InputEvent> > (p_name=..., this=0x495ac910) at ./core/object/object.h:918
#10 Window::_window_input (this=0x495ac910, p_ev=...) at scene/main/window.cpp:1675
#11 0x0000000002aa69e4 in call_with_variant_args_helper<Window, Ref<InputEvent> const&, 0ul> (r_error=..., p_args=<optimized out>, p_method=<optimized out>, p_instance=<optimized out>)
    at ./core/variant/binder_common.h:304
#12 call_with_variant_args<Window, Ref<InputEvent> const&> (r_error=..., p_argcount=<optimized out>, p_args=<optimized out>, p_method=<optimized out>, p_instance=<optimized out>)
    at ./core/variant/binder_common.h:418
#13 CallableCustomMethodPointer<Window, void, Ref<InputEvent> const&>::call (this=<optimized out>, p_arguments=<optimized out>, p_argcount=<optimized out>, r_return_value=..., r_call_error=...)
    at ./core/object/callable_method_pointer.h:107
#14 0x000000000046b555 in Callable::call<Ref<InputEvent> > (this=this@entry=0x7fffc9babe70) at ./core/variant/variant.h:905
#15 0x000000000047cdf2 in DisplayServerX11::_dispatch_input_event (this=0x47c51c90, p_event=...) at platform/linuxbsd/x11/display_server_x11.cpp:4080
#16 0x00000000046a5c66 in Input::_parse_input_event_impl (this=<optimized out>, p_event=..., p_is_emulated=<optimized out>) at core/input/input.cpp:902
#17 0x00000000046a892f in Input::flush_buffered_events (this=0x47b45ff0) at core/input/input.cpp:1183
#18 0x0000000000483c43 in DisplayServerX11::process_events (this=0x47c51c90) at platform/linuxbsd/x11/display_server_x11.cpp:5216
#19 0x0000000000454a50 in OS_LinuxBSD::run (this=this@entry=0x7fffc9bac1d0) at platform/linuxbsd/os_linuxbsd.cpp:958
#20 0x0000000000423637 in main (argc=<optimized out>, argv=0x7fffc9bac828) at platform/linuxbsd/godot_linuxbsd.cpp:85

I suspect that it’s a combination of #98891 which doesn’t properly validate the p_shortcut before dereferencing it (cc @Faless) and #97707 / #99449 which likely corrupted the shortcut mappings in @caioraphael1’s Editor Settings (cc @Sauermann).

I can make a quick fix for the first part (missing validation check). For the corrupted shortcuts in Editor Settings, if my hunch is correct, this was just bad luck from testing 4.4-dev4 which introduced a compat breaking change to input events, which we reverted in dev5, but with compatibility code only for Project Settings, not Editor Settings. You can fix this locally by removing/redoing the editor custom hotkeys.

It’s actually related to the editor_settings-4.4.tres file in the Roaming/Godot/ folder. Deleting this file makes the crash disappear.

Why? No ideia. Tho, as mentioned, when I upgraded from a custom 4.4-dev5 build to the 4.4-dev6, I’ve made some changes to some hotkeys.

My editor_settings-4.4.tres: editor_settings-4.4.txt (change the extension to .tres)

here’s the new MRP: mrp.zip

In my instance this looks more like bugs in my code not checking for nullptr or indexes outside array size rather than in Godot.

I couldn’t reproduce this in a simple project.

If you can’t share the project or a MRP that triggers the issue, it would also be helpful if you could try to figure out what feature your project is using that might trigger this issue.

I notice this in the logs:

(Virtual Joystick) The Project Setting 'emulate_mouse_from_touch' should be set to False
(Virtual Joystick) The Project Setting 'emulate_touch_from_mouse' should be set to True

That’s not a Godot message, I assume it comes from a thirdparty plugin?

Without the project no one can help you (and the trace is useless)

I know you mean well, but this sounds quite dismissive, please pay attention to the way you phrase things.


@caioraphael1 Can you try making your custom build with debug_symbols=yes, which should add debug symbols and produce a more useful stacktrace?

The problem might be related to changes in the InputMap. Could you share the contents of your control mappings in project.godot? Also if you’re using version control, you can check if/how that file changed in successive upgrades.

The reason your shortcut was invalid is either:

  • You removed it, so there’s no shortcut, and that would crash before #100218. This is now fixed, removing the shortcut is now supported.
  • You changed it to a valid shortcut, but as pointed out we changed and rolled back some compat breaking changes to the InputEvent format which might have corrupted your configured hotkeys between 4.4-dev4 and 4.4-dev5. So this was a transient bug during the development phase, which is fixed already, but requires testers affected by it to remake their shortcut mappings, or restore default editor shortcuts.

I have tried to reproduce the crash, but I was unable to do so, using the MRP with the provided Editor Settings (I have copied the editor settings to ~/.config/godot/editor_settings-4.4.tres and verified, that this file is used). After loading the project, I am pressing some keys, but I don’t cause a crash. (I have tested Linux with Godot a372214a4 and 4.4-dev6(1f47e4c4e) )

So I’m not sure, what I’m doing different - it would be great for me, to be able to cause the crash in order to identify the reason for the invalid shortcuts.

Looking at the code of editor_settings-4.4.tres, I can see no obvious effects from #97707: There are no stale device = -3 assignments in the file, which would be problematic. I’m wondering, if that file should contain these device = -1 assignments and if their inclusion needs to be considered a problem.

Edit: Update: Now I was able to recreate the crash.

Trace of 4.4-dev6, using debug symbols.

================================================================
CrashHandlerException: Program crashed
Engine version: Godot Engine v4.4.dev.custom_build (1f47e4c4e3a09a422e96880a7918d986dd575a63)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[0] Array::size (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\core\variant\array.cpp:116)
[1] Array::size (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\core\variant\array.cpp:116)
[2] Shortcut::matches_event (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\core\input\shortcut.cpp:64)
[3] SceneDebugger::_handle_input (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\scene\debugger\scene_debugger.cpp:99)
[4] CallableCustomStaticMethodPointer<void,Ref<InputEvent> const &,Ref<Shortcut> const &>::call (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\core\object\callable_method_pointer.h:251)
[5] Callable::callp (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\core\variant\callable.cpp:58)
[6] CallableCustomBind::call (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\core\variant\callable_bind.cpp:151)
[7] Callable::callp (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\core\variant\callable.cpp:58)
[8] Object::emit_signalp (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\core\object\object.cpp:1203)
[9] Node::emit_signalp (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\scene\main\node.cpp:3989)
[10] Window::_window_input (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\scene\main\window.cpp:1675)
[11] CallableCustomMethodPointer<Window,void,Ref<InputEvent> const &>::call (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\core\object\callable_method_pointer.h:107)
[12] Callable::callp (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\core\variant\callable.cpp:58)
[13] Callable::call<Ref<InputEvent> > (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\core\variant\variant.h:906)
[14] DisplayServerWindows::_dispatch_input_event (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\platform\windows\display_server_windows.cpp:3821)
[15] Input::_parse_input_event_impl (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\core\input\input.cpp:903)
[16] Input::flush_buffered_events (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\core\input\input.cpp:1184)
[17] DisplayServerWindows::process_events (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\platform\windows\display_server_windows.cpp:3275)
[18] OS_Windows::run (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\platform\windows\os_windows.cpp:1999)
[19] widechar_main (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\platform\windows\godot_windows.cpp:181)
[20] _main (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\platform\windows\godot_windows.cpp:208)
[21] main (C:\Users\caior\Desktop\Programas\! Godot Launchers\godot_master\platform\windows\godot_windows.cpp:220)
[22] __scrt_common_main_seh (D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
[23] <couldn't map PC to fn name>
-- END OF BACKTRACE --
================================================================

It’s [1f47e4c4e3a09a422e96880a7918d986dd575a63], you can find it on the release blog near the bottom

Well that went a lot smoother than expected (apart from a bug when using target=template_debug, removing fixed). Here’s your improved debug output…

================================================================
CrashHandlerException: Program crashed
Engine version: Godot Engine v4.4.dev.custom_build (aa8d9b83f66488dbb2c9c918e9016ef80f821fb4)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[0] Variant::operator Object * (C:\dev\godot\core\variant\variant.cpp:2160)
[1] Variant::operator Object * (C:\dev\godot\core\variant\variant.cpp:2160)
[2] VariantTypeConstructor<Object *>::type_from_variant (C:\dev\godot\core\variant\variant_internal.h:1584)
[3] godot::Variant::operator godot::Object * (C:\dev\godot_project\gdextension\godot-cpp\src\variant\variant.cpp:443)
[4] godot::UIControlTabBar::_ready (C:\dev\godot_project\gdextension\src\ui\controls\ui_control_tab_bar.cpp:35)
[5] Node::_gdvirtual__ready_call (C:\dev\godot\scene\main\node.h:385)
[6] Node::_notification (C:\dev\godot\scene\main\node.cpp:228)
[7] Node::_notificationv (C:\dev\godot\scene\main\node.h:50)
[8] CanvasItem::_notificationv (C:\dev\godot\scene\main\canvas_item.h:45)
[9] Control::_notificationv (C:\dev\godot\scene\gui\control.h:47)
[10] Container::_notificationv (C:\dev\godot\scene\gui\container.h:37)
[11] BoxContainer::_notificationv (C:\dev\godot\scene\gui\box_container.h:37)
[12] HBoxContainer::_notificationv (C:\dev\godot\scene\gui\box_container.h:81)
[13] Object::notification (C:\dev\godot\core\object\object.cpp:878)
[14] Node::_propagate_ready (C:\dev\godot\scene\main\node.cpp:283)
[15] Node::_propagate_ready (C:\dev\godot\scene\main\node.cpp:274)
[16] Node::_propagate_ready (C:\dev\godot\scene\main\node.cpp:274)
[17] Node::_propagate_ready (C:\dev\godot\scene\main\node.cpp:274)
[18] Node::_propagate_ready (C:\dev\godot\scene\main\node.cpp:274)
[19] Node::_propagate_ready (C:\dev\godot\scene\main\node.cpp:274)
[20] Node::_propagate_ready (C:\dev\godot\scene\main\node.cpp:274)
[21] Node::_propagate_ready (C:\dev\godot\scene\main\node.cpp:274)
[22] Node::_propagate_ready (C:\dev\godot\scene\main\node.cpp:274)
[23] Node::_propagate_ready (C:\dev\godot\scene\main\node.cpp:274)
[24] Node::_set_tree (C:\dev\godot\scene\main\node.cpp:3262)
[25] SceneTree::initialize (C:\dev\godot\scene\main\scene_tree.cpp:481)
[26] OS_Windows::run (C:\dev\godot\platform\windows\os_windows.cpp:1997)
[27] widechar_main (C:\dev\godot\platform\windows\godot_windows.cpp:181)
[28] _main (C:\dev\godot\platform\windows\godot_windows.cpp:206)
[29] main (C:\dev\godot\platform\windows\godot_windows.cpp:220)
[30] WinMain (C:\dev\godot\platform\windows\godot_windows.cpp:234)
[31] __scrt_common_main_seh (D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
[32] <couldn't map PC to fn name>
-- END OF BACKTRACE --
================================================================

@GameArchitekt To get more information you’d need to build the Godot editor with debug_symbols=yes, not just the GDExtension.

Thanks, will give that a go to try and assist. I’ve been putting off building the editor as I’m only 2 months into using C++ (having spent two decades using C#).

@GameArchitekt To get more information you’d need to build the Godot editor with debug_symbols=yes, not just the GDExtension.