godot icon indicating copy to clipboard operation
godot copied to clipboard

Crash on file rename or move

Open wilfredjonathanjames opened this issue 2 years ago • 17 comments

Godot version

4.2.dev5

System information

MacOS 12.3

Issue description

When renaming or moving a file in-editor, Godot crashes. Happens 99.9% of the time.

Video of the issue here.

Steps to reproduce

  1. Load a project
  2. Move a directory containing files that are used by other scenes
  3. Wait for the crash

Minimal reproduction project

I don't think an MRP is necessary, but if you can't replicate I'll give it a go.

Edit: I attempted to find duplicate issues but didn't find any. I'd be surprised if an issue didn't already exist but I'm raising this just in case.

wilfredjonathanjames avatar Oct 02 '23 01:10 wilfredjonathanjames

Can you reproduce this in 4.1.1, or only in 4.2.dev5? If you can't reproduce this in 4.1.1, please also test 4.2.dev4 and older dev builds. You can download them here.

Calinou avatar Oct 02 '23 01:10 Calinou

Both 4.1.1 and 4.2.dev4 have the crash.

wilfredjonathanjames avatar Oct 02 '23 01:10 wilfredjonathanjames

Should be fixed by #81725

Jordyfel avatar Oct 02 '23 11:10 Jordyfel

Please test in the upcoming 4.2-dev6 (should be released tomorrow most likely) and confirm.

akien-mga avatar Oct 02 '23 12:10 akien-mga

Crash is still immediately reproducible in 4.2-dev6. Sorry guys

wilfredjonathanjames avatar Oct 03 '23 22:10 wilfredjonathanjames

If close all scenes (or scenes that use these resource files), will it crash? Can you provide the crash log?

Rindbee avatar Oct 03 '23 22:10 Rindbee

Yes, that seems to be the case. If all scenes are closed there is no crash. There's no crash log in the user data directory or elsewhere that I can find.

wilfredjonathanjames avatar Oct 03 '23 22:10 wilfredjonathanjames

The post-crash popup may contain useful information.

Rindbee avatar Oct 03 '23 22:10 Rindbee

Ah I'd posted one on a similar issue and someone told me it wasn't helpful. You can find my system crashlog here.

wilfredjonathanjames avatar Oct 03 '23 23:10 wilfredjonathanjames

I reproduced a crash, but I'm not sure if it's the same one.

Steps to reproduce:

  1. Create a new project;
  2. Add a glb file (cube.glb) to the project directory;
  3. Create 3 directories a, b, c
  4. Create a 3D scene, use cube.glb to instantiate the sub-scene, save the scene (cube.tscn) and close it.
  5. Move cube.glb and cube.tscn to directory a.
  6. Create another 3D scene, use cube.tscn to instantiate the sub-scene, save the scene (node_3d.tscn), and open cube.tscn again. (The order of the opened scene tabs seems to be the key.) node_3d.tscn is in the project root directory.
  7. Moved directory a to b, no errors, no crashes. (Judging from the error message something still needs to be updated.)
  8. Then move the directory a from b to c, output an error, and then crash.
ERROR: Cannot open file 'res://b/a/cube.tscn'.
   at: load (scene/resources/resource_format_text.cpp:1641)
ERROR: Failed loading resource: res://b/a/cube.tscn. Make sure resources have been imported by opening the project in the editor at least once.
   at: _load (core/io/resource_loader.cpp:275)
ERROR: Method/function failed. Returning: err
   at: pack (scene/resources/packed_scene.cpp:1077)
ERROR: Condition "err != OK" is true. Returning: false
   at: check_and_update_scene (editor/editor_data.cpp:700)
================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.2.dev.custom_build (f5696c311cdb09e0a34fa4ba7ef5d2524c515b89)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7fb71a042520] (??:0)
[2] /opt/godot/godot-editor-l10n/godot/bin/godot.linuxbsd.editor.dev.x86_64.llvm(__dynamic_cast+0x2d) [0x556ff886c50d] (??:?)
[3] Node* Object::cast_to<Node>(Object*) (/opt/godot/godot-editor-l10n/godot/./core/object/object.h:792)
[4] VariantObjectClassChecker<Node*>::check(Variant const&) (/opt/godot/godot-editor-l10n/godot/./core/variant/binder_common.h:230)
[5] VariantCasterAndValidate<Node*>::cast(Variant const**, unsigned int, Callable::CallError&) (/opt/godot/godot-editor-l10n/godot/./core/variant/binder_common.h:255)
[6] void call_with_variant_args_helper<__UnexistingClass, Dictionary, Node*, 0ul, 1ul>(__UnexistingClass*, void (__UnexistingClass::*)(Dictionary, Node*), Variant const**, Callable::CallError&, IndexSequence<0ul, 1ul>) (/opt/godot/godot-editor-l10n/godot/./core/variant/binder_common.h:303)
[7] void call_with_variant_args_dv<__UnexistingClass, Dictionary, Node*>(__UnexistingClass*, void (__UnexistingClass::*)(Dictionary, Node*), Variant const**, int, Callable::CallError&, Vector<Variant> const&) (/opt/godot/godot-editor-l10n/godot/./core/variant/binder_common.h:451)
[8] MethodBindT<Dictionary, Node*>::call(Object*, Variant const**, int, Callable::CallError&) const (/opt/godot/godot-editor-l10n/godot/./core/object/method_bind.h:335)
[9] Object::callp(StringName const&, Variant const**, int, Callable::CallError&) (/opt/godot/godot-editor-l10n/godot/core/object/object.cpp:766)
[10] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (/opt/godot/godot-editor-l10n/godot/core/variant/callable.cpp:62)
[11] CallQueue::_call_function(Callable const&, Variant const*, int, bool) (/opt/godot/godot-editor-l10n/godot/core/object/message_queue.cpp:220)
[12] CallQueue::flush() (/opt/godot/godot-editor-l10n/godot/core/object/message_queue.cpp:326)
[13] SceneTree::physics_process(double) (/opt/godot/godot-editor-l10n/godot/scene/main/scene_tree.cpp:471)
[14] Main::iteration() (/opt/godot/godot-editor-l10n/godot/main/main.cpp:3545)
[15] OS_LinuxBSD::run() (/opt/godot/godot-editor-l10n/godot/platform/linuxbsd/os_linuxbsd.cpp:933)
[16] /opt/godot/godot-editor-l10n/godot/bin/godot.linuxbsd.editor.dev.x86_64.llvm(main+0x1a0) [0x556ff3e24890] (/opt/godot/godot-editor-l10n/godot/platform/linuxbsd/godot_linuxbsd.cpp:76)
[17] /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7fb71a029d90] (??:0)
[18] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7fb71a029e40] (??:0)
[19] /opt/godot/godot-editor-l10n/godot/bin/godot.linuxbsd.editor.dev.x86_64.llvm(_start+0x25) [0x556ff3e24625] (??:?)
-- END OF BACKTRACE --
================================================================

Open the project again and perform the above operations. You will only get errors and no crashes. Therefore, I could not provide an MRP to reproduce the crash.

Edit:

After the crash, the files were successfully moved, but the path of source_file in cube.glb.import was not updated. (Resources in other scene files have been updated to new paths.)

source_file="res://b/a/cube.glb"

Rindbee avatar Oct 04 '23 00:10 Rindbee

After the crash, the files were successfully moved, but the path of source_file in cube.glb.import was not updated. (Resources in other scene files have been updated to new paths.)

This does sound like what I'm seeing, though I suppose it's possible I'm experiencing two separate crashes.

It's a long shot, but is it possible this is related to https://github.com/godotengine/godot/issues/82422?

wilfredjonathanjames avatar Oct 04 '23 02:10 wilfredjonathanjames

This issue happens 80% of the time when I move C# scripts that are connected to nodes in scenes from one folder to another. Although the editor does not crash, scenes fail to open and the game won't run anymore. I find I have to move one script, test the game to see if it still works, if it does work then commit these changes through git. Then repeat the process for the next script. Very tedious..

For example I move Player.cs script from folder A to folder B. player_ship.tscn fails to update with the new path for the player script. Which means I can't open this scene anymore unless I go into a text editor and manually edit the path. Tested on 4.1.1-stable for Windows 11. Have yet to test on 4.2-dev-x build.

valkyrienyanko avatar Oct 06 '23 00:10 valkyrienyanko

Can replicate in 4.2-beta1. Video here. Possibly related to another .glb import crash I've reported here https://github.com/godotengine/godot/issues/82398

Also bumped into something else while replicating that may be related. Moving a file by dragging - no modifier keys pressed - ended up copying it, and trying to overwrite one with the other led to a crash. Video here.

wilfredjonathanjames avatar Oct 17 '23 21:10 wilfredjonathanjames

I am not sure if this is related, but on 4.1.2 stable, sometimes I can't rename a file. Minimal steps to reproduce: work on a scene that's saved as .tscn. then close it in the editor [or keep it]. Try to rename the scene file. It won't edit the name.

Hacky way to fix it: Select another file by mouse left click. then select the previous file again. Now you can edit the name.

AvikArefin avatar Oct 25 '23 07:10 AvikArefin

Here is minimal repro of renaming AnimationTree node in hierarchy causes crash. Directions in ReadMe or in main script, also Output log included. ...never done git before so hope this is right/okay. Min Repro Rename Bug

GigglingGalaxy avatar Apr 30 '24 14:04 GigglingGalaxy

@GigglingGalaxy Your bug seems different, please test on 4.3 dev 5 and if it is still present, open a new issue

Jordyfel avatar Apr 30 '24 14:04 Jordyfel

Adding some info here - ran into this issue and figured out that we had deleted the Git plugin, but not changed the setting that references it.

version_control/plugin_name="GitPlugin"

With that line in, but no GitPlugin add-on, the editor would crash renaming files. Once we removed this, the crashes stopped.

fdstevex avatar Aug 27 '24 00:08 fdstevex