godot icon indicating copy to clipboard operation
godot copied to clipboard

Editor crashes when saving scene with tool script

Open JackToaster opened this issue 6 years ago • 2 comments

On Godot_v3.1.1-stable_x11.64 on Arch Linux, the editor crashes when saving a scene with the following script:

tool
extends Spatial

export(NodePath) var path

# Called when the node enters the scene tree for the first time.
func _ready():
	path = get_node(path)

The editor will crash upon saving as long as path is unset. Taking out the line with tool will prevent the editor from crashing while saving. Strangely, adding tool back in to the script and then saving will not crash the editor, but next time the project is loaded the editor will crash upon saving again. I do not know if this script crashes the game upon running because the editor will crash when saving whenever I try to run the project. The workaround for this is to not do the above action in a script. Simply doing var node = get_node(path) instead of path = get_node(path) will prevent the crash from occurring.

Steps for reproducing:

  1. Create a new project
  2. Make a scene with a Spatial node (I have yet to try other nodes) that has the above script
  3. Close the editor and re-open it
  4. Save the project

JackToaster avatar Nov 04 '19 17:11 JackToaster

MInimal project - AAA.zip Just try to run scene

This crash, because there is infinite recurrence inside Godot Zrzut ekranu z 2019-11-05 06-23-08

qarmin avatar Nov 05 '19 05:11 qarmin

Still valid in 94e5f66 EDIT: also sounds similar to #35669

KoBeWi avatar Oct 16 '20 14:10 KoBeWi