godotengine / godot

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

Engine crashes when modifying tool script #74607

Open nonunknown opened 1 year ago

nonunknown commented 1 year ago

Godot version

4.0 stable

System information

manjaro linux

Issue description

when modifying an tool script the engine crashes

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.0.stable.official (92bee43adba8d2401ef40e2480e53087bcb1eaf1)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x38f50) [0x7f4489f0ff50] (??:0)
[2] /run/media/nonunknown/3a1f3657-ce4a-4ffa-8f65-f41e1dfcaf68/4Godot.x86_64() [0x4634528] (??:0)
[3] /run/media/nonunknown/3a1f3657-ce4a-4ffa-8f65-f41e1dfcaf68/4Godot.x86_64() [0x1271370] (??:0)
[4] /run/media/nonunknown/3a1f3657-ce4a-4ffa-8f65-f41e1dfcaf68/4Godot.x86_64() [0x43a4897] (??:0)
[5] /run/media/nonunknown/3a1f3657-ce4a-4ffa-8f65-f41e1dfcaf68/4Godot.x86_64() [0x43c31ab] (??:0)
[6] /run/media/nonunknown/3a1f3657-ce4a-4ffa-8f65-f41e1dfcaf68/4Godot.x86_64() [0x43d1966] (??:0)
[7] /run/media/nonunknown/3a1f3657-ce4a-4ffa-8f65-f41e1dfcaf68/4Godot.x86_64() [0x45d8d04] (??:0)
[8] /run/media/nonunknown/3a1f3657-ce4a-4ffa-8f65-f41e1dfcaf68/4Godot.x86_64() [0x2bc32fd] (??:0)
[9] /run/media/nonunknown/3a1f3657-ce4a-4ffa-8f65-f41e1dfcaf68/4Godot.x86_64() [0x2bd12db] (??:0)
[10] /run/media/nonunknown/3a1f3657-ce4a-4ffa-8f65-f41e1dfcaf68/4Godot.x86_64() [0xec07db] (??:0)
[11] /run/media/nonunknown/3a1f3657-ce4a-4ffa-8f65-f41e1dfcaf68/4Godot.x86_64() [0xe027f3] (??:0)
[12] /usr/lib/libc.so.6(+0x23790) [0x7f4489efa790] (??:0)
[13] /usr/lib/libc.so.6(__libc_start_main+0x8a) [0x7f4489efa84a] (??:0)
[14] /run/media/nonunknown/3a1f3657-ce4a-4ffa-8f65-f41e1dfcaf68/4Godot.x86_64() [0xe2286e] (??:0)
-- END OF BACKTRACE --
================================================================

not very useful stack trace, but its the message!

Steps to reproduce

Minimal reproduction project

MRP-ToolReload.zip

akien-mga commented 1 year ago

Confirmed, here's a stacktrace with debug symbols:

test
test
test
test
ERROR: FATAL: Index p_index = 0 is out of bounds (size() = 0).
   at: get (./core/templates/cowdata.h:155)

================================================================
handle_crash: Program crashed with signal 4
Engine version: Godot Engine v4.1.dev.custom_build (bed6c1dc4913b7137ba5dca814544c58f8dd34e0)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /lib64/libc.so.6(+0x36940) [0x7f00fd157940] (??:0)
[2] CowData<GDScriptDataType>::get(int) const (/home/akien/Projects/godot/godot.git/./core/templates/cowdata.h:155 (discriminator 7))
[3] Vector<GDScriptDataType>::operator[](int) const (/home/akien/Projects/godot/godot.git/./core/templates/vector.h:93)
[4] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*) (/home/akien/Projects/godot/godot.git/modules/gdscript/gdscript_vm.cpp:544)
[5] GDScriptLambdaCallable::call(Variant const**, int, Variant&, Callable::CallError&) const (/home/akien/Projects/godot/godot.git/modules/gdscript/gdscript_lambda_callable.cpp:82 (discriminator 4))
[6] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (/home/akien/Projects/godot/godot.git/core/variant/callable.cpp:64)
[7] Object::emit_signalp(StringName const&, Variant const**, int) (/home/akien/Projects/godot/godot.git/core/object/object.cpp:1047)
[8] Error Object::emit_signal<>(StringName const&) (/home/akien/Projects/godot/godot.git/./core/object/object.h:869)
[9] SceneTree::process_timers(double, bool) (/home/akien/Projects/godot/godot.git/scene/main/scene_tree.cpp:537)
[10] SceneTree::process(double) (/home/akien/Projects/godot/godot.git/scene/main/scene_tree.cpp:478)
[11] Main::iteration() (/home/akien/Projects/godot/godot.git/main/main.cpp:3161)
[12] OS_LinuxBSD::run() (/home/akien/Projects/godot/godot.git/platform/linuxbsd/os_linuxbsd.cpp:880)
[13] godot-git(main+0x15a) [0x52df100] (/home/akien/Projects/godot/godot.git/platform/linuxbsd/godot_linuxbsd.cpp:75)
[14] /lib64/libc.so.6(+0x23677) [0x7f00fd144677] (??:0)
[15] /lib64/libc.so.6(__libc_start_main+0x85) [0x7f00fd144735] (??:0)
[16] godot-git(_start+0x21) [0x52deee1] (??:?)
-- END OF BACKTRACE --
================================================================
Aborted (core dumped)
akien-mga commented 1 year ago

Tested against in latest master, the exact steps to reproduce no longer caused a crash, but then trying to disable "Active" crashed:

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.1.beta.custom_build (9ab388c146895cfacf87d09d28c148e186f348b6)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /lib64/libc.so.6(+0x36980) [0x7fd40d961980] (??:0)
[2] Variant::callp(StringName const&, Variant const**, int, Variant&, Callable::CallError&) (/home/akien/Projects/godot/godot.git/./core/variant/variant_call.cpp:1174)
[3] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*) (/home/akien/Projects/godot/godot.git/./modules/gdscript/gdscript_vm.cpp:1690)
[4] GDScriptInstance::callp(StringName const&, Variant const**, int, Callable::CallError&) (/home/akien/Projects/godot/godot.git/./modules/gdscript/gdscript.cpp:1892)
[5] GDScriptInstance::set(StringName const&, Variant const&) (/home/akien/Projects/godot/godot.git/./modules/gdscript/gdscript.cpp:1570 (discriminator 2))
[6] Object::set(StringName const&, Variant const&, bool*) (/home/akien/Projects/godot/godot.git/./core/object/object.cpp:228)
[7] UndoRedo::_process_operation_list(List<UndoRedo::Operation, DefaultAllocator>::Element*) (/home/akien/Projects/godot/godot.git/./core/object/undo_redo.cpp:368)
[8] UndoRedo::_redo(bool) (/home/akien/Projects/godot/godot.git/./core/object/undo_redo.cpp:77)
[9] UndoRedo::commit_action(bool) (/home/akien/Projects/godot/godot.git/./core/object/undo_redo.cpp:307)
[10] EditorUndoRedoManager::commit_action(bool) (/home/akien/Projects/godot/godot.git/./editor/editor_undo_redo_manager.cpp:243)
[11] EditorInspector::_edit_set(String const&, Variant const&, bool, String const&) (/home/akien/Projects/godot/godot.git/./editor/editor_inspector.cpp:3731)
[12] EditorInspector::_property_changed(String const&, Variant const&, String const&, bool, bool) (/home/akien/Projects/godot/godot.git/./editor/editor_inspector.cpp:3749)
[13] void call_with_variant_args_helper<EditorInspector, String const&, Variant const&, String const&, bool, bool, 0ul, 1ul, 2ul, 3ul, 4ul>(EditorInspector*, void (EditorInspector::*)(String const&, Variant const&, String const&, bool, bool), Variant const**, Callable::CallError&, IndexSequence<0ul, 1ul, 2ul, 3ul, 4ul>) (/home/akien/Projects/godot/godot.git/./core/variant/binder_common.h:303 (discriminator 12))
[14] void call_with_variant_args<EditorInspector, String const&, Variant const&, String const&, bool, bool>(EditorInspector*, void (EditorInspector::*)(String const&, Variant const&, String const&, bool, bool), Variant const**, int, Callable::CallError&) (/home/akien/Projects/godot/godot.git/./core/variant/binder_common.h:418)
[15] CallableCustomMethodPointer<EditorInspector, String const&, Variant const&, String const&, bool, bool>::call(Variant const**, int, Variant&, Callable::CallError&) const (/home/akien/Projects/godot/godot.git/./core/object/callable_method_pointer.h:105)
[16] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (/home/akien/Projects/godot/godot.git/./core/variant/callable.cpp:64)
[17] CallableCustomBind::call(Variant const**, int, Variant&, Callable::CallError&) const (/home/akien/Projects/godot/godot.git/./core/variant/callable_bind.cpp:145)
[18] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (/home/akien/Projects/godot/godot.git/./core/variant/callable.cpp:64)
[19] Object::emit_signalp(StringName const&, Variant const**, int) (/home/akien/Projects/godot/godot.git/./core/object/object.cpp:1069)
[20] Node::emit_signalp(StringName const&, Variant const**, int) (/home/akien/Projects/godot/godot.git/./scene/main/node.cpp:3564)
[21] EditorProperty::emit_changed(StringName const&, Variant const&, StringName const&, bool) (/home/akien/Projects/godot/godot.git/./editor/editor_inspector.cpp:116 (discriminator 4))
[22] EditorPropertyCheck::_checkbox_pressed() (/home/akien/Projects/godot/godot.git/./editor/editor_properties.cpp:656 (discriminator 8))
[23] void call_with_variant_args_helper<EditorPropertyCheck>(EditorPropertyCheck*, void (EditorPropertyCheck::*)(), Variant const**, Callable::CallError&, IndexSequence<>) (/home/akien/Projects/godot/godot.git/./core/variant/binder_common.h:308 (discriminator 4))
[24] void call_with_variant_args<EditorPropertyCheck>(EditorPropertyCheck*, void (EditorPropertyCheck::*)(), Variant const**, int, Callable::CallError&) (/home/akien/Projects/godot/godot.git/./core/variant/binder_common.h:418)
[25] CallableCustomMethodPointer<EditorPropertyCheck>::call(Variant const**, int, Variant&, Callable::CallError&) const (/home/akien/Projects/godot/godot.git/./core/object/callable_method_pointer.h:105)
[26] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (/home/akien/Projects/godot/godot.git/./core/variant/callable.cpp:64)
[27] Object::emit_signalp(StringName const&, Variant const**, int) (/home/akien/Projects/godot/godot.git/./core/object/object.cpp:1069)
[28] Node::emit_signalp(StringName const&, Variant const**, int) (/home/akien/Projects/godot/godot.git/./scene/main/node.cpp:3564)
[29] Error Object::emit_signal<>(StringName const&) (/home/akien/Projects/godot/godot.git/./core/object/object.h:881)
[30] BaseButton::_pressed() (/home/akien/Projects/godot/godot.git/./scene/gui/base_button.cpp:139)
[31] BaseButton::on_action_event(Ref<InputEvent>) (/home/akien/Projects/godot/godot.git/./scene/gui/base_button.cpp:168)
[32] BaseButton::gui_input(Ref<InputEvent> const&) (/home/akien/Projects/godot/godot.git/./scene/gui/base_button.cpp:69 (discriminator 4))
[33] Control::_call_gui_input(Ref<InputEvent> const&) (/home/akien/Projects/godot/godot.git/./scene/gui/control.cpp:1806)
[34] Viewport::_gui_call_input(Control*, Ref<InputEvent> const&) (/home/akien/Projects/godot/godot.git/./scene/main/viewport.cpp:1543)
[35] Viewport::_gui_input_event(Ref<InputEvent>) (/home/akien/Projects/godot/godot.git/./scene/main/viewport.cpp:1811 (discriminator 8))
[36] Viewport::push_input(Ref<InputEvent> const&, bool) (/home/akien/Projects/godot/godot.git/./scene/main/viewport.cpp:2976 (discriminator 4))
[37] Window::_window_input(Ref<InputEvent> const&) (/home/akien/Projects/godot/godot.git/./scene/main/window.cpp:1476)
[38] void call_with_variant_args_helper<Window, Ref<InputEvent> const&, 0ul>(Window*, void (Window::*)(Ref<InputEvent> const&), Variant const**, Callable::CallError&, IndexSequence<0ul>) (/home/akien/Projects/godot/godot.git/./core/variant/binder_common.h:303 (discriminator 8))
[39] void call_with_variant_args<Window, Ref<InputEvent> const&>(Window*, void (Window::*)(Ref<InputEvent> const&), Variant const**, int, Callable::CallError&) (/home/akien/Projects/godot/godot.git/./core/variant/binder_common.h:418)
[40] CallableCustomMethodPointer<Window, Ref<InputEvent> const&>::call(Variant const**, int, Variant&, Callable::CallError&) const (/home/akien/Projects/godot/godot.git/./core/object/callable_method_pointer.h:105)
[41] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (/home/akien/Projects/godot/godot.git/./core/variant/callable.cpp:64)
[42] DisplayServerX11::_dispatch_input_event(Ref<InputEvent> const&) (/home/akien/Projects/godot/godot.git/platform/linuxbsd/x11/display_server_x11.cpp:3723)
[43] DisplayServerX11::_dispatch_input_events(Ref<InputEvent> const&) (/home/akien/Projects/godot/godot.git/platform/linuxbsd/x11/display_server_x11.cpp:3693)
[44] Input::_parse_input_event_impl(Ref<InputEvent> const&, bool) (/home/akien/Projects/godot/godot.git/./core/input/input.cpp:719)
[45] Input::flush_buffered_events() (/home/akien/Projects/godot/godot.git/./core/input/input.cpp:977)
[46] DisplayServerX11::process_events() (/home/akien/Projects/godot/godot.git/platform/linuxbsd/x11/display_server_x11.cpp:4790)
[47] OS_LinuxBSD::run() (/home/akien/Projects/godot/godot.git/platform/linuxbsd/os_linuxbsd.cpp:910)
[48] godot-git(main+0x15a) [0x56770c0] (/home/akien/Projects/godot/godot.git/platform/linuxbsd/godot_linuxbsd.cpp:76)
[49] /lib64/libc.so.6(+0x236b7) [0x7fd40d94e6b7] (??:0)
[50] /lib64/libc.so.6(__libc_start_main+0x85) [0x7fd40d94e775] (??:0)
[51] godot-git(_start+0x21) [0x5676ea1] (??:?)
-- END OF BACKTRACE --
================================================================
Aborted (core dumped)