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

Crash on file rename or move #82652

Open
wilfredjonathanjames opened this issue Oct 2, 2023 · 16 comments
Open

Crash on file rename or move #82652

wilfredjonathanjames opened this issue Oct 2, 2023 · 16 comments

Comments

@wilfredjonathanjames
Copy link

wilfredjonathanjames commented Oct 2, 2023

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.

@Calinou
Copy link
Member

Calinou commented Oct 2, 2023

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.

@wilfredjonathanjames
Copy link
Author

wilfredjonathanjames commented Oct 2, 2023

Both 4.1.1 and 4.2.dev4 have the crash.

@wilfredjonathanjames wilfredjonathanjames changed the title Crash on file rename or move [4.2.dev5] Regression - Crash on file rename or move Oct 2, 2023
@wilfredjonathanjames wilfredjonathanjames changed the title [4.2.dev5] Regression - Crash on file rename or move Crash on file rename or move Oct 2, 2023
@Jordyfel
Copy link
Contributor

Jordyfel commented Oct 2, 2023

Should be fixed by #81725

@akien-mga akien-mga added this to the 4.2 milestone Oct 2, 2023
@akien-mga
Copy link
Member

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

@wilfredjonathanjames
Copy link
Author

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

@Rindbee
Copy link
Contributor

Rindbee commented Oct 3, 2023

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

@wilfredjonathanjames
Copy link
Author

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.

@Rindbee
Copy link
Contributor

Rindbee commented Oct 3, 2023

The post-crash popup may contain useful information.

@wilfredjonathanjames
Copy link
Author

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

@Rindbee
Copy link
Contributor

Rindbee commented Oct 4, 2023

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"

@wilfredjonathanjames
Copy link
Author

wilfredjonathanjames commented Oct 4, 2023

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 #82422?

@valkyrienyanko
Copy link

valkyrienyanko commented Oct 6, 2023

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.

@wilfredjonathanjames
Copy link
Author

Can replicate in 4.2-beta1. Video here. Possibly related to another .glb import crash I've reported here #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.

@AvikArefin
Copy link

AvikArefin commented Oct 25, 2023

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.

@GigglingGalaxy
Copy link

GigglingGalaxy commented Apr 30, 2024

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

@Jordyfel
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants