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

Saving a plugin while the game is running and the await keyword was used causes a plethora of engine errors. #101059

Open
carsonetb opened this issue Jan 3, 2025 · 2 comments

Comments

@carsonetb
Copy link
Contributor

Tested versions

Tested in 4.3.stable

System information

Godot v4.3.stable - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4070 SUPER (NVIDIA; 32.0.15.6636) - 13th Gen Intel(R) Core(TM) i5-13600KF (20 Threads)

Issue description

Whenever I edit a autoload script loaded by a plugin (like adding a print statement) while the game is running and I hit ctrl+s, the engine seems to break. This only happens if I create an await for a timer to timeout (see script below) and the script is an autoload. Here are a few of the errors that have happened:

  • Internal script error! Opcode: 0 (please report)
  • Stack Underflow (Engine Bug)
  • Game just crashes with no debug after a few seconds.
  • Bad address index (stack frames show one frame with this broken text: "0 - :21 - at function: ").
  • Invalid assignment of property or key " with value of type 'Node2D (script.gd)' on a base object of type 'Node2D (script.gd)'.

Yes I know this bug is extremely specific but it's still weird, plus one of the errors says please report.

Steps to reproduce

  1. Create a plugin.
  2. Create a new script in the plugins folder (the autoload) and put this script in there:
extends Node2D

func _ready() -> void:
	while true:
		await get_tree().create_timer(0.1).timeout

func test() -> void:
	print("hello!")
	pass
  1. In the plugin script put this code in:
@tool
extends EditorPlugin


func _enter_tree() -> void:
	# Initialization of the plugin goes here.
	pass

func _enable_plugin() -> void:
	add_autoload_singleton("test", "path-to-autoload")

func _disable_plugin() -> void:
	remove_autoload_singleton("test")

func _exit_tree() -> void:
	# Clean-up of the plugin goes here.
	pass
  1. Run the game (with a basic scene with just a Node2D or something in it)
  2. Delete the print statement and save the script.
  3. Something bad will probably happen.

Minimal reproduction project (MRP)

N/A

@carsonetb carsonetb changed the title Saving a autoload script while the game is running and the await keyword was used causes a plethora of engine errors. Saving a plugin while the game is running and the await keyword was used causes a plethora of engine errors. Jan 3, 2025
@carsonetb
Copy link
Contributor Author

Yeah it's related but I don't think it's exactly the same ... this error is caused by changing any code at all, even a print statement in a function that isn't run, while a timer is running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: For team assessment
Development

No branches or pull requests

2 participants