godot icon indicating copy to clipboard operation
godot copied to clipboard

Godot crashes when node not found, and attempting to connect to a non existant signal

Open JustinBraben opened this issue 1 year ago • 3 comments

Tested versions

v4.3.stable.official.77dcf97d8

System information

Windows 10 - Godot 4.3 stable - Vulkan 1.3.280 - Forward+

Issue description

My 2D project is experiencing a continuous crash on open, believed to be due to a corrupted scene. The crash occurs immediately upon opening the project.

Steps to reproduce

  1. Created custom resource to store ProjectileData
  2. Created a custom Projectile which extended CharacterBody2D, which had @export var stats: Resource which was the ProjectileData above
  3. Created a PlayerBeam which extended Projectile
  4. Attempted to add a Timer node to the base Projectile, but encountered issues starting the Timer
  5. Removed the Timer node from Projectile and its connected signal functions
  6. Added the Timer node to PlayerBeam instead
  7. Attempted to create a new inherited scene from player_beam.tscn (PlayerBeam), which resulted in a crash

Stack trace found in console:

Godot Engine v4.3.stable.official.77dcf97d8 - https://godotengine.org
Vulkan 1.3.280 - Forward+ - Using Device #0: NVIDIA - NVIDIA GeForce RTX 3080

<Resource#-9223370267546291730>
ERROR: Cannot get path of node as it is not in a scene tree.
   at: (scene/main/node.cpp:2257)
ERROR: Condition "!is_inside_tree()" is true. Returning: false
   at: can_process (scene/main/node.cpp:835)
ERROR: Nonexistent signal: editor_description_changed.
   at: (core/object/object.cpp:1441)
ERROR: In Object of type 'Object': Attempt to connect nonexistent signal 'editor_description_changed' to callable 'Scen.
   at: (core/object/object.cpp:1390)
ERROR: Node not found: "" (relative to "/root/@EditorNode@16886/@Panel@13/@VBoxContainer@14/DockHSplitLeftL/DockHSplitL.
   at: (scene/main/node.cpp:1792)
ERROR: Cannot get path of node as it is not in a scene tree.
   at: (scene/main/node.cpp:2257)
ERROR: Condition "!is_inside_tree()" is true. Returning: false
   at: can_process (scene/main/node.cpp:835)
ERROR: Nonexistent signal: editor_description_changed.
   at: (core/object/object.cpp:1441)
ERROR: In Object of type 'Object': Attempt to connect nonexistent signal 'editor_description_changed' to callable 'Scen.
   at: (core/object/object.cpp:1390)
ERROR: Cannot get path of node as it is not in a scene tree.
   at: (scene/main/node.cpp:2257)
ERROR: Condition "!is_inside_tree()" is true. Returning: false
   at: can_process (scene/main/node.cpp:835)
ERROR: Nonexistent signal: editor_description_changed.
   at: (core/object/object.cpp:1441)
ERROR: In Object of type 'Object': Attempt to connect nonexistent signal 'editor_description_changed' to callable 'Scen.
   at: (core/object/object.cpp:1390)
ERROR: Node not found: "" (relative to "/root/@EditorNode@16886/@Panel@13/@VBoxContainer@14/DockHSplitLeftL/DockHSplitL.
   at: (scene/main/node.cpp:1792)

================================================================
CrashHandlerException: Program crashed with signal 11
Engine version: Godot Engine v4.3.stable.official (77dcf97d82cbfe4e4615475fa52ca03da645dbd8)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] error(-1): no debug info in PE/COFF executable
[2] error(-1): no debug info in PE/COFF executable
[3] error(-1): no debug info in PE/COFF executable
[4] error(-1): no debug info in PE/COFF executable
[5] error(-1): no debug info in PE/COFF executable
[6] error(-1): no debug info in PE/COFF executable
[7] error(-1): no debug info in PE/COFF executable
[8] error(-1): no debug info in PE/COFF executable
[9] error(-1): no debug info in PE/COFF executable
[10] error(-1): no debug info in PE/COFF executable
[11] error(-1): no debug info in PE/COFF executable
[12] error(-1): no debug info in PE/COFF executable
[13] error(-1): no debug info in PE/COFF executable
[14] error(-1): no debug info in PE/COFF executable
[15] error(-1): no debug info in PE/COFF executable
[16] error(-1): no debug info in PE/COFF executable
-- END OF BACKTRACE --
================================================================

Minimal reproduction project (MRP)

  1. Open the project.
  2. Project should open normally
  3. If you double click player_beam.tscn in the godot editor FileSystem, the project will promptly crash
  4. Subsequent attempts to open the project will immediately crash

mrp_nonexistent_signal_after_create_inherited.zip

JustinBraben avatar Sep 19 '24 17:09 JustinBraben

As a workaround, I can delete the contents of my .godot folder to reopen the project successfully. But trying to open the player_beam.tscn will bring back the crashes.

JustinBraben avatar Sep 19 '24 17:09 JustinBraben

I can reproduce it. This is caused by deleting the scene root in the tool script. It is an edge case. Some update methods do not take this into account.

When setting the scene root, we may also need to consider connecting and disconnecting the node's tree_exited signal.

Rindbee avatar Sep 21 '24 06:09 Rindbee

Ok! I figured I was probably doing something odd. Thank you for looking at it

JustinBraben avatar Sep 23 '24 14:09 JustinBraben

I am also experiencing this and my editor keeps dying in a random moment, any solution for this?

gth1030 avatar Dec 29 '24 03:12 gth1030

@gth1030 When I was experiencing this I cleared the contents of the .godot folder and was able to reopen my project. I ended up deleting the problem object and rewriting it to avoid opening it in the godot editor again and promptly crashing.

JustinBraben avatar Jan 06 '25 16:01 JustinBraben

cc @AThousandShips

Tested in v4.4.1.stable. While I cannot get it to automatically reopen player_beam.tscn after crashing, I can replicate the behavior when, for instance, manually reloading the project.

Like many other cases, @tool scripts come with the risk of causing endless crashes on the engine due to their nature. I've confirmed the recovery mode feature on v4.4.1 can detect this scenario and allow you to open the project and make changes to "recover" the project, so hopefully this is enough to mitigate future issues of this kind.

rsubtil avatar Apr 24 '25 13:04 rsubtil