godotengine / godot

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

Editor crash when opening project #90235

Closed Rindbee closed 7 months ago

Rindbee commented 7 months ago

Tested versions

f47f4a02c good 79de2eaae bad

System information

Godot v4.3.dev (f47f4a02c) - Linux Mint 21.3 (Virginia) - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1050 Ti (nvidia; 535.161.07) - Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz (4 Threads)

Issue description

If you exit the editor with scene tabs open, and the active scene tab is not the last one, it will crash the next time you open the project.

Crash log when reloading the project.

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.3.dev.custom_build (79de2eaae7fb3bb8f13031ac2ec9b19128b6f471)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
ERROR: FATAL: Index p_index = 1 is out of bounds (size() = 0).
   at: get (./core/templates/cowdata.h:205)

Crash log when reopening the project.

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.3.dev.custom_build (b345614adb7cb17aa3b9ee2cd17b413a54fa40b7)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x78656f042520] (??:0)
[2] /opt/godot/godot/bin/godot.linuxbsd.editor.dev.x86_64.llvm(__dynamic_cast+0x2d) [0x5bc007806c7d] (??:?)
[3] TreeItem* Object::cast_to<TreeItem>(Object*) (/opt/godot/godot/./core/object/object.h:802)
[4] VariantObjectClassChecker<TreeItem*>::check(Variant const&) (/opt/godot/godot/./core/variant/binder_common.h:231)
[5] VariantCasterAndValidate<TreeItem*>::cast(Variant const**, unsigned int, Callable::CallError&) (/opt/godot/godot/./core/variant/binder_common.h:256)
[6] void call_with_variant_args_helper<Tree, TreeItem*, bool, 0ul, 1ul>(Tree*, void (Tree::*)(TreeItem*, bool), Variant const**, Callable::CallError&, IndexSequence<0ul, 1ul>) (/opt/godot/godot/./core/variant/binder_common.h:304)
[7] void call_with_variant_args<Tree, TreeItem*, bool>(Tree*, void (Tree::*)(TreeItem*, bool), Variant const**, int, Callable::CallError&) (/opt/godot/godot/./core/variant/binder_common.h:419)
[8] CallableCustomMethodPointer<Tree, TreeItem*, bool>::call(Variant const**, int, Variant&, Callable::CallError&) const (/opt/godot/godot/./core/object/callable_method_pointer.h:104)
[9] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (/opt/godot/godot/core/variant/callable.cpp:58)
[10] CallQueue::_call_function(Callable const&, Variant const*, int, bool) (/opt/godot/godot/core/object/message_queue.cpp:222)
[11] CallQueue::flush() (/opt/godot/godot/core/object/message_queue.cpp:328)
[12] SceneTree::process(double) (/opt/godot/godot/scene/main/scene_tree.cpp:537)
[13] Main::iteration() (/opt/godot/godot/main/main.cpp:4010)
[14] OS_LinuxBSD::run() (/opt/godot/godot/platform/linuxbsd/os_linuxbsd.cpp:938)
[15] /opt/godot/godot/bin/godot.linuxbsd.editor.dev.x86_64.llvm(main+0x18e) [0x5bc0026488fe] (/opt/godot/godot/platform/linuxbsd/godot_linuxbsd.cpp:86)
[16] /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x78656f029d90] (??:0)
[17] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x78656f029e40] (??:0)
[18] /opt/godot/godot/bin/godot.linuxbsd.editor.dev.x86_64.llvm(_start+0x25) [0x5bc0026486a5] (??:?)
-- END OF BACKTRACE --
================================================================

Steps to reproduce

  1. Create a new project and open;
  2. Create new scenes and save;
  3. Select any scene tab except the last one;
  4. Save to let the editor remember the selection;
  5. Reload the project, crash;
  6. Reopen the project, crash;

Minimal reproduction project (MRP)

N/A

fire commented 7 months ago

Initial testing says e302fb2167aabcd83001e7f5d61e809f8f662692 is the broken pull request.

akien-mga commented 7 months ago

CC @RedMser