Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dragging and dropping node(s) in the Scene dock may cause error message #99111

Closed
Rindbee opened this issue Nov 12, 2024 · 4 comments
Closed

Comments

@Rindbee
Copy link
Contributor

Rindbee commented Nov 12, 2024

Tested versions

System information

Godot v4.4.dev2 - Linux Mint 22 (Wilma) - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1050 Ti (nvidia; 535.183.01) - Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz (4 Threads)

Issue description

When dragging and dropping nodes in the Scene dock, the following error message may be generated:

ERROR: Index p_column = 0 is out of bounds (cells.size() = 0).
   at: clear_custom_color (scene/gui/tree.cpp:1418)
001.mp4

Bisected to #96124. CC @AeioMuch

002.mp4

In some worse cases (when the node can be added as a sibling node, release the mouse after the color of the node changes), the editor will crash.

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.4.dev.custom_build (ec6a1c0e792ac8be44990749800a4654a293b9ee)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x45320) [0x790f68c45320] (??:0)
[2] CowData<TreeItem::Cell>::size() const (/opt/godot/godot/./core/templates/cowdata.h:183)
[3] Vector<TreeItem::Cell>::size() const (/opt/godot/godot/./core/templates/vector.h:94)
[4] TreeItem::clear_custom_color(int) (/opt/godot/godot/scene/gui/tree.cpp:1418)
[5] SceneTreeDock::_notification(int) (/opt/godot/godot/editor/scene_tree_dock.cpp:1719)
[6] SceneTreeDock::_notificationv(int, bool) (/opt/godot/godot/editor/scene_tree_dock.h:53)
[7] Object::notification(int, bool) (/opt/godot/godot/core/object/object.cpp:?)
[8] Viewport::_propagate_drag_notification(Node*, int) (/opt/godot/godot/scene/main/viewport.cpp:1242)
[9] Viewport::_propagate_drag_notification(Node*, int) (/opt/godot/godot/scene/main/viewport.cpp:1243)
[10] Viewport::_propagate_drag_notification(Node*, int) (/opt/godot/godot/scene/main/viewport.cpp:1243)
[11] Viewport::_propagate_drag_notification(Node*, int) (/opt/godot/godot/scene/main/viewport.cpp:1243)
[12] Viewport::_propagate_drag_notification(Node*, int) (/opt/godot/godot/scene/main/viewport.cpp:1243)
[13] Viewport::_propagate_drag_notification(Node*, int) (/opt/godot/godot/scene/main/viewport.cpp:1243)
[14] Viewport::_propagate_drag_notification(Node*, int) (/opt/godot/godot/scene/main/viewport.cpp:1243)
[15] Viewport::_propagate_drag_notification(Node*, int) (/opt/godot/godot/scene/main/viewport.cpp:1243)
[16] Viewport::_propagate_drag_notification(Node*, int) (/opt/godot/godot/scene/main/viewport.cpp:1243)
[17] Viewport::_perform_drop(Control*) (/opt/godot/godot/scene/main/viewport.cpp:2207)
[18] Viewport::_gui_input_event(Ref<InputEvent>) (/opt/godot/godot/scene/main/viewport.cpp:?)
[19] Viewport::push_input(Ref<InputEvent> const&, bool) (/opt/godot/godot/scene/main/viewport.cpp:3176)
[20] Window::_window_input(Ref<InputEvent> const&) (/opt/godot/godot/scene/main/window.cpp:1651)
[21] void call_with_variant_args_helper<Window, Ref<InputEvent> const&, 0ul>(Window*, void (Window::*)(Ref<InputEvent> const&), Variant const**, Callable::CallError&, IndexSequence<0ul>) (/opt/godot/godot/./core/variant/binder_common.h:304)
[22] void call_with_variant_args<Window, Ref<InputEvent> const&>(Window*, void (Window::*)(Ref<InputEvent> const&), Variant const**, int, Callable::CallError&) (/opt/godot/godot/./core/variant/binder_common.h:419)
[23] CallableCustomMethodPointer<Window, void, Ref<InputEvent> const&>::call(Variant const**, int, Variant&, Callable::CallError&) const (/opt/godot/godot/./core/object/callable_method_pointer.h:111)
[24] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (/opt/godot/godot/core/variant/callable.cpp:58)
[25] Variant Callable::call<Ref<InputEvent> >(Ref<InputEvent>) const (/opt/godot/godot/./core/variant/variant.h:905)
[26] DisplayServerX11::_dispatch_input_event(Ref<InputEvent> const&) (/opt/godot/godot/platform/linuxbsd/x11/display_server_x11.cpp:4076)
[27] DisplayServerX11::_dispatch_input_events(Ref<InputEvent> const&) (/opt/godot/godot/platform/linuxbsd/x11/display_server_x11.cpp:4053)
[28] Input::_parse_input_event_impl(Ref<InputEvent> const&, bool) (/opt/godot/godot/core/input/input.cpp:902)
[29] Input::flush_buffered_events() (/opt/godot/godot/core/input/input.cpp:1184)
[30] DisplayServerX11::process_events() (/opt/godot/godot/platform/linuxbsd/x11/display_server_x11.cpp:5213)
[31] OS_LinuxBSD::run() (/opt/godot/godot/platform/linuxbsd/os_linuxbsd.cpp:958)
[32] godot-llvm-dev(main+0x18e) [0x58e9d6b269be] (/opt/godot/godot/platform/linuxbsd/godot_linuxbsd.cpp:86)
[33] /lib/x86_64-linux-gnu/libc.so.6(+0x2a1ca) [0x790f68c2a1ca] (??:0)
[34] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x8b) [0x790f68c2a28b] (??:0)
[35] godot-llvm-dev(_start+0x25) [0x58e9d6b26765] (??:?)
-- END OF BACKTRACE --
================================================================

Steps to reproduce

  1. Create a scene and add some nodes in the editor;
  2. Select one or some nodes and start dragging;
  3. Hover the mouse over a node and wait for the node name under the mouse to change color;
    3.1. If a node box is displayed before the color changes, it means that it can be added as a child node. Move the mouse slightly up or down and release the mouse when the dragged node can be added as a sibling node of the hovered node. An error message will be output.
    3.2. If a line is displayed before the color changes, it can be added as a sibling node. It will crash when you release the mouse.

Minimal reproduction project (MRP)

N/A

@AeioMuch
Copy link
Contributor

AeioMuch commented Nov 27, 2024

Should get fixed by #99700, which supersedes #99122

@KoBeWi
Copy link
Member

KoBeWi commented Dec 7, 2024

Can't reproduce it.

nobughere.mp4

@AeioMuch
Copy link
Contributor

AeioMuch commented Dec 7, 2024

I can still reproduce it on master [aa8d9b8]. It seems that when compiling with g++ it does also crash as @Rindbee showed, while when compiling with LLVM/Clang it does only print the error and haven't been able to crash it. Maybe MSVC does something differently that prevent the bug entierly ? Or something else, no idea lol

Regardless there's three options : if #99700 is merged for 4.4, we're good to go.
If not, I have a PR #99122 that does fix it anyway.
Or we simply revert #96124 and merge it back once #99700 is merged.

@AeioMuch
Copy link
Contributor

Fixed by #99700

@KoBeWi KoBeWi closed this as completed Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants