godotengine / godot

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

Editor crash when moving scene file and referenced shader #67970

Closed dzil123 closed 1 year ago

dzil123 commented 2 years ago

Godot version

v4.0.beta3.official.01ae26d31 and v4.0.beta.custom_build.468762b3b

System information

Arch Linux

Issue description

When moving a scene file and a shader file (referenced by that scene) into a different folder, while that scene is open, the editor crashes.

Godot Engine v4.0.beta.custom_build.1fa8b3dd4 - https://godotengine.org
Vulkan API 1.2.0 - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce GT 710

WARNING: Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
     at: _editor_init (modules/gltf/register_types.cpp:76)
WARNING: FBX file import is enabled in the project settings, but no FBX2glTF path is configured in the editor settings. FBX files will not be imported.
     at: _editor_init (modules/gltf/register_types.cpp:100)

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.0.beta.custom_build (1fa8b3dd420301dd5c2ad99b6bead6cffe1d4995)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x38a00) [0x7f1d0537aa00] (??:0)
[2] ./godot/bin/godot.linuxbsd.editor.dev.x86_64(__dynamic_cast+0x2d) [0x777e1fd] (??:?)
[3] Node3D* Object::cast_to<Node3D>(Object*) (./godot/./core/object/object.h:738 (discriminator 1))
[4] Node3DEditor::_request_gizmo(Object*) (./godot/editor/plugins/node_3d_editor_plugin.cpp:7362)
[5] void call_with_variant_args_helper<__UnexistingClass, Object*, 0ul>(__UnexistingClass*, void (__UnexistingClass::*)(Object*), Variant const**, Callable::CallError&, IndexSequence<0ul>) (./godot/./core/variant/binder_common.h:267 (discriminator 4))
[6] void call_with_variant_args_dv<__UnexistingClass, Object*>(__UnexistingClass*, void (__UnexistingClass::*)(Object*), Variant const**, int, Callable::CallError&, Vector<Variant> const&) (./godot/./core/variant/binder_common.h:410)
[7] MethodBindT<Object*>::call(Object*, Variant const**, int, Callable::CallError&) (./godot/./core/object/method_bind.h:320)
[8] Object::callp(StringName const&, Variant const**, int, Callable::CallError&) (./godot/core/object/object.cpp:733 (discriminator 2))
[9] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (./godot/core/variant/callable.cpp:62)
[10] MessageQueue::_call_function(Callable const&, Variant const*, int, bool) (./godot/core/object/message_queue.cpp:230)
[11] MessageQueue::flush() (./godot/core/object/message_queue.cpp:277)
[12] SceneTree::physics_process(double) (./godot/scene/main/scene_tree.cpp:432)
[13] Main::iteration() (./godot/main/main.cpp:3140)
[14] OS_LinuxBSD::run() (./godot/platform/linuxbsd/os_linuxbsd.cpp:776)
[15] ./godot/bin/godot.linuxbsd.editor.dev.x86_64(main+0x19b) [0x25c8fb1] (./godot/platform/linuxbsd/godot_linuxbsd.cpp:75)
[16] /usr/lib/libc.so.6(+0x23290) [0x7f1d05365290] (??:0)
[17] /usr/lib/libc.so.6(__libc_start_main+0x8a) [0x7f1d0536534a] (??:0)
[18] ./godot/bin/godot.linuxbsd.editor.dev.x86_64(_start+0x25) [0x25c8d55] (/build/glibc/src/glibc/csu/../sysdeps/x86_64/start.S:117)
-- END OF BACKTRACE --
================================================================
Aborted (core dumped)

Steps to reproduce

  1. Open the project, containing a MeshInstance3D .tscn file referencing a .gdshader file and an empty folder.
  2. Open scene.tscn if it is not opened automatically.
  3. Select scene.tscn and new_shader.gdshader in the FileSystem dock.
  4. Drag both files to the folder. Editor should crash.
  5. If editor does not crash: save the scene, then move both files out of the folder into the root, and editor should crash.

Minimal reproduction project

Project.zip

Tuckertcs commented 1 year ago

Not sure if it's caused by the same bug, or just a similar issue, but I noticed renaming a folder containing scripts also caused Godot to crash.

Mikeysax commented 1 year ago

Same, renaming folders crashes the editor. Godot 4 beta 4

KoBeWi commented 1 year ago

Can't reproduce in cd491c6

If editor does not crash: save the scene, then move both files out of the folder into the root, and editor should crash. Minimal reproduction project

Does not crash either.

henriquelalves commented 1 year ago

For me, any file refactoring on Godot 4.0 (any beta) often crashes the editor (renaming folder, moving folders, renaming scripts, etc.). I'm not sure what causes it exactly, so I can't make an easily reproducible project; but I tend to believe it has something to do with opened scenes in the editor that have a dependency with the files being refactored (e.g. if you have a scene opened that depends on a resource you are moving from a folder to another)

KoBeWi commented 1 year ago

^ This should be fixed in beta 9.

reduz commented 1 year ago

Ping to check if this was effectively fixed

Mikeysax commented 1 year ago

Ping to check if this was effectively fixed

This kinda seems to be happening still but it's acting differently. When renaming a directory with nested folders with files, it leaves the directory with those folders empty. Clicking on those empty folders crashes godot.

This is using Manjaro 6.1.1 and Godot 4 beta 11.

In the following video:

1) I rename the player directory (it's currently open) which contains animations, meshes, and other related player code. 2) It ends up triggering a re-import, throws an error popup, and then... 3) It shows the new playerr directory and the old player directory in the file tree. 4) Opening the old player directory shows two empty directories which cause the engine to crash when clicking on them.

https://user-images.githubusercontent.com/15805689/212304555-d7b1c5de-8631-45e1-8f93-93aabca0fe7c.mp4

Output from terminal:

Editing project: /home/mikeysax/Documents/Code/maskless
Godot Engine v4.0.beta11.official.91713ced8 - https://godotengine.org
Vulkan API 1.3.230 - Using Vulkan Device #1: AMD - AMD Radeon RX 6700M (RADV NAVI22)
    ~/Documents                                                                                                                                                                                   ✔  4s  
SCRIPT ERROR: Parse Error: Preload file "res://src/gridmaps/test_floor/test.tscn" does not exist.
          at: GDScript::reload (res://src/scenes/levels/test/test.gd:22)
SCRIPT ERROR: Parse Error: Could not resolve type for variable "floor_grid_map_scene".
          at: GDScript::reload (res://src/scenes/levels/test/test.gd:22)
SCRIPT ERROR: Parse Error: Preload file "res://src/scenes/player.player.tscn" does not exist.
          at: GDScript::reload (res://src/scenes/levels/test/test.gd:25)
SCRIPT ERROR: Parse Error: Could not resolve type for variable "player_scene".
          at: GDScript::reload (res://src/scenes/levels/test/test.gd:25)
SCRIPT ERROR: Parse Error: "Player" was not found in the current scope.
          at: GDScript::reload (res://src/scenes/levels/test/test.gd:30)
SCRIPT ERROR: Parse Error: "ProceduralLevel" was not found in the current scope.
          at: GDScript::reload (res://src/scenes/levels/test/test.gd:31)
SCRIPT ERROR: Parse Error: "MeshPlacer" was not found in the current scope.
          at: GDScript::reload (res://src/scenes/levels/test/test.gd:32)
SCRIPT ERROR: Parse Error: Identifier "ProceduralLevel" not declared in the current scope.
          at: GDScript::reload (res://src/scenes/levels/test/test.gd:45)
SCRIPT ERROR: Parse Error: Identifier "MeshPlacer" not declared in the current scope.
          at: GDScript::reload (res://src/scenes/levels/test/test.gd:46)
ERROR: Attempt to disconnect a nonexistent connection from 'Skeleton3D:<Skeleton3D#1930118099878>'. Signal: 'bone_pose_changed', callable: 'BoneAttachment3D::on_bone_pose_update'.
   at: _disconnect (core/object/object.cpp:1327)
ERROR: Attempt to disconnect a nonexistent connection from 'Skeleton3D:<Skeleton3D#1930118099878>'. Signal: 'bone_pose_changed', callable: 'BoneAttachment3D::on_bone_pose_update'.
   at: _disconnect (core/object/object.cpp:1327)
ERROR: Attempt to disconnect a nonexistent connection from 'Skeleton3D:<Skeleton3D#1930118099878>'. Signal: 'bone_pose_changed', callable: 'BoneAttachment3D::on_bone_pose_update'.
   at: _disconnect (core/object/object.cpp:1327)
ERROR: Attempt to disconnect a nonexistent connection from 'Skeleton3D:<Skeleton3D#1930118099878>'. Signal: 'bone_pose_changed', callable: 'BoneAttachment3D::on_bone_pose_update'.
   at: _disconnect (core/object/object.cpp:1327)
ERROR: Signal 'bone_pose_changed' is already connected to given callable 'BoneAttachment3D::on_bone_pose_update' in that object.
   at: connect (core/object/object.cpp:1270)
ERROR: Signal 'bone_pose_changed' is already connected to given callable 'BoneAttachment3D::on_bone_pose_update' in that object.
   at: connect (core/object/object.cpp:1270)
ERROR: Signal 'bone_pose_changed' is already connected to given callable 'BoneAttachment3D::on_bone_pose_update' in that object.
   at: connect (core/object/object.cpp:1270)
ERROR: Signal 'bone_pose_changed' is already connected to given callable 'BoneAttachment3D::on_bone_pose_update' in that object.
   at: connect (core/object/object.cpp:1270)
ERROR: Condition "!uniform_set" is true.
   at: compute_list_bind_uniform_set (drivers/vulkan/rendering_device_vulkan.cpp:7806)
ERROR: Uniforms were never supplied for set (2) at the time of drawing, which are required by the pipeline
   at: compute_list_dispatch (drivers/vulkan/rendering_device_vulkan.cpp:8005)
ERROR: Condition "!uniform_set" is true.
   at: compute_list_bind_uniform_set (drivers/vulkan/rendering_device_vulkan.cpp:7806)
ERROR: Uniforms were never supplied for set (2) at the time of drawing, which are required by the pipeline
   at: compute_list_dispatch (drivers/vulkan/rendering_device_vulkan.cpp:8005)
ERROR: Cannot open file 'res://src/scenes/player/player.tscn'.
   at: load (scene/resources/resource_format_text.cpp:1584)
ERROR: Failed loading resource: res://src/scenes/player/player.tscn. Make sure resources have been imported by opening the project in the editor at least once.
   at: _load (core/io/resource_loader.cpp:214)
ERROR: Method/function failed. Returning: err
   at: pack (scene/resources/packed_scene.cpp:952)
ERROR: Cannot save file 'res://src/scenes/player/player_animation_tree_root.tres'.
   at: save (scene/resources/resource_format_text.cpp:1877)
ERROR: Attempt to disconnect a nonexistent connection from 'Skeleton3D:<Skeleton3D#3501824472040>'. Signal: 'bone_pose_changed', callable: 'BoneAttachment3D::on_bone_pose_update'.
   at: _disconnect (core/object/object.cpp:1327)
ERROR: Attempt to disconnect a nonexistent connection from 'Skeleton3D:<Skeleton3D#3501824472040>'. Signal: 'bone_pose_changed', callable: 'BoneAttachment3D::on_bone_pose_update'.
   at: _disconnect (core/object/object.cpp:1327)
ERROR: Attempt to disconnect a nonexistent connection from 'Skeleton3D:<Skeleton3D#3501824472040>'. Signal: 'bone_pose_changed', callable: 'BoneAttachment3D::on_bone_pose_update'.
   at: _disconnect (core/object/object.cpp:1327)
ERROR: Attempt to disconnect a nonexistent connection from 'Skeleton3D:<Skeleton3D#3501824472040>'. Signal: 'bone_pose_changed', callable: 'BoneAttachment3D::on_bone_pose_update'.
   at: _disconnect (core/object/object.cpp:1327)
ERROR: Transient parent has another exclusive child.
   at: set_visible (scene/main/window.cpp:707)
ERROR: Cannot create file 'res://src/scenes/player/animations/AdditiveLeanBackward.res'.
   at: save (core/io/resource_format_binary.cpp:1999)
ERROR: Saving of animation failed: res://src/scenes/player/animations/AdditiveLeanBackward.res
   at: _save_animation_to_file (editor/import/resource_importer_scene.cpp:1411)
ERROR: Cannot create file 'res://src/scenes/player/animations/AdditiveLeanForward.res'.
   at: save (core/io/resource_format_binary.cpp:1999)
ERROR: Saving of animation failed: res://src/scenes/player/animations/AdditiveLeanForward.res
   at: _save_animation_to_file (editor/import/resource_importer_scene.cpp:1411)
ERROR: Cannot create file 'res://src/scenes/player/animations/AdditiveLeanLeft.res'.
   at: save (core/io/resource_format_binary.cpp:1999)
ERROR: Saving of animation failed: res://src/scenes/player/animations/AdditiveLeanLeft.res
   at: _save_animation_to_file (editor/import/resource_importer_scene.cpp:1411)
ERROR: Cannot create file 'res://src/scenes/player/animations/AdditiveLeanRight.res'.
   at: save (core/io/resource_format_binary.cpp:1999)
ERROR: Saving of animation failed: res://src/scenes/player/animations/AdditiveLeanRight.res
   at: _save_animation_to_file (editor/import/resource_importer_scene.cpp:1411)
ERROR: Cannot create file 'res://src/scenes/player/animations/FallLeft.res'.
   at: save (core/io/resource_format_binary.cpp:1999)
ERROR: Saving of animation failed: res://src/scenes/player/animations/FallLeft.res
   at: _save_animation_to_file (editor/import/resource_importer_scene.cpp:1411)
ERROR: Cannot create file 'res://src/scenes/player/animations/FallRight.res'.
   at: save (core/io/resource_format_binary.cpp:1999)
ERROR: Saving of animation failed: res://src/scenes/player/animations/FallRight.res
   at: _save_animation_to_file (editor/import/resource_importer_scene.cpp:1411)
ERROR: Cannot create file 'res://src/scenes/player/animations/Idle.res'.
   at: save (core/io/resource_format_binary.cpp:1999)
ERROR: Saving of animation failed: res://src/scenes/player/animations/Idle.res
   at: _save_animation_to_file (editor/import/resource_importer_scene.cpp:1411)
ERROR: Cannot create file 'res://src/scenes/player/animations/JumpLeft.res'.
   at: save (core/io/resource_format_binary.cpp:1999)
ERROR: Saving of animation failed: res://src/scenes/player/animations/JumpLeft.res
   at: _save_animation_to_file (editor/import/resource_importer_scene.cpp:1411)
ERROR: Cannot create file 'res://src/scenes/player/animations/JumpRight.res'.
   at: save (core/io/resource_format_binary.cpp:1999)
ERROR: Saving of animation failed: res://src/scenes/player/animations/JumpRight.res
   at: _save_animation_to_file (editor/import/resource_importer_scene.cpp:1411)
ERROR: Cannot create file 'res://src/scenes/player/animations/Landing.res'.
   at: save (core/io/resource_format_binary.cpp:1999)
ERROR: Saving of animation failed: res://src/scenes/player/animations/Landing.res
   at: _save_animation_to_file (editor/import/resource_importer_scene.cpp:1411)
ERROR: Cannot create file 'res://src/scenes/player/animations/Run.res'.
   at: save (core/io/resource_format_binary.cpp:1999)
ERROR: Saving of animation failed: res://src/scenes/player/animations/Run.res
   at: _save_animation_to_file (editor/import/resource_importer_scene.cpp:1411)
ERROR: Cannot create file 'res://src/scenes/player/animations/TPose.res'.
   at: save (core/io/resource_format_binary.cpp:1999)
ERROR: Saving of animation failed: res://src/scenes/player/animations/TPose.res
   at: _save_animation_to_file (editor/import/resource_importer_scene.cpp:1411)
ERROR: Cannot create file 'res://src/scenes/player/animations/Walk.res'.
   at: save (core/io/resource_format_binary.cpp:1999)
ERROR: Saving of animation failed: res://src/scenes/player/animations/Walk.res
   at: _save_animation_to_file (editor/import/resource_importer_scene.cpp:1411)
ERROR: Cannot create file 'res://src/scenes/player/meshes/Cape.res'.
   at: save (core/io/resource_format_binary.cpp:1999)
ERROR: Cannot create file 'res://src/scenes/player/meshes/Hood.res'.
   at: save (core/io/resource_format_binary.cpp:1999)
ERROR: Cannot create file 'res://src/scenes/player/meshes/Body.res'.
   at: save (core/io/resource_format_binary.cpp:1999)

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.0.beta11.official (91713ced81792b10fdc9367b7f355738e5d52777)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x38a00) [0x7f17d38fba00] (??:0)
[2] /home/mikeysax/Documents/Godot_v4.0-beta11_linux.x86_64() [0x4b03d44] (??:0)
[3] /home/mikeysax/Documents/Godot_v4.0-beta11_linux.x86_64() [0x1e3b805] (??:0)
[4] /home/mikeysax/Documents/Godot_v4.0-beta11_linux.x86_64() [0xefbeda] (??:0)
[5] /home/mikeysax/Documents/Godot_v4.0-beta11_linux.x86_64() [0x4435578] (??:0)
[6] /home/mikeysax/Documents/Godot_v4.0-beta11_linux.x86_64() [0x4250e14] (??:0)
[7] /home/mikeysax/Documents/Godot_v4.0-beta11_linux.x86_64() [0x49eac55] (??:0)
[8] /home/mikeysax/Documents/Godot_v4.0-beta11_linux.x86_64() [0x44c8117] (??:0)
[9] /home/mikeysax/Documents/Godot_v4.0-beta11_linux.x86_64() [0x2a943b8] (??:0)
[10] /home/mikeysax/Documents/Godot_v4.0-beta11_linux.x86_64() [0xe930b6] (??:0)
[11] /home/mikeysax/Documents/Godot_v4.0-beta11_linux.x86_64() [0xdc7083] (??:0)
[12] /usr/lib/libc.so.6(+0x23290) [0x7f17d38e6290] (??:0)
[13] /usr/lib/libc.so.6(__libc_start_main+0x8a) [0x7f17d38e634a] (??:0)
[14] /home/mikeysax/Documents/Godot_v4.0-beta11_linux.x86_64() [0xde634e] (??:0)
-- END OF BACKTRACE --
================================================================
SaracenOne commented 1 year ago

I checked this, and it appears that the initial issue was fixed. However, with @Mikeysax's issue, I've so far not been able to reproduce it either. If it's a problem, it should be opened as a new issue.

KoBeWi commented 1 year ago

@dzil123 @Mikeysax Can any of you still reproduce the crash in rc2?

No matter what I try, it doesn't crash for me. I wonder if it's system-specific 🤔

dzil123 commented 1 year ago

I cannot reproduce a crash with my original issue.