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

TextEdit in plugin with wrap and fit_content_height enabled can result in crash #80546

Closed
Jowan-Spooner opened this issue Aug 12, 2023 · 4 comments

Comments

@Jowan-Spooner
Copy link

Godot version

4.2.dev3, 4.1.1-stable

System information

Windows 10, (probably macOS 13.4.1 as well)

Issue description

When used in a plugin, a TextEdit that has fit_content_height and wrap mode enabled but only limited space to extend to will crash godot once the text get's too long.

I discovered this bug while fixing a bug for dialogic: https://github.com/coppolaemilio/dialogic/issues/1675
The user that discovered it was using mac OS 13.4.1 and godot 4.1.1 so I assume that this issue is present there too.

This issue seemed similar, but has to do with the RichTextLabel and is apparently fixed: RichTextLabel freezes Godot 4.1-rc2 on Fit Content #78932

I was not able to reproduce the problem in running games, only in plugins!
2023-08-12-15-16-36

Steps to reproduce

  • create a super simple plugin with code like this:
@tool
extends EditorPlugin

func _enter_tree():
	if get_editor_interface().is_plugin_enabled('test'):
		_enable_plugin()

func _enable_plugin():
	get_editor_interface().get_editor_main_screen().add_child(preload("res://Test.tscn").instantiate())

func _get_plugin_name():
	return "Test"

func _has_main_screen():
	return true
  • setup the "res://Test.tscn" scene like this:
    • Control
      ---- Scroll Container (make it relatively small, so you need less text to enter for the crash)
      -------- Vbox (expand horizontal & vertical)
      ----------- TextEdit (fit_content_height = true; wrap_mode = Boundary)
  • enable the plugin
  • select the TextEdit in the new editor tab and start spamming any letters.
    -> once the text edit fills the whole Scroll Container godot crashes

Minimal reproduction project

TestTextEditCrashBug.zip (has been created following the steps above)

  • Open project
  • Switch to the "Test" tab
  • select the Text edit
  • start spamming any letter until the field is filled.
    -> crash
@Rindbee
Copy link
Contributor

Rindbee commented Aug 15, 2023

It seems to be stuck in an infinite loop, similar to #75713.

@akien-mga akien-mga added the bug label Aug 15, 2023
@akien-mga akien-mga changed the title TextEdit in plugin with wrap and fit_content_height enabled can result in crash TextEdit in plugin with wrap and fit_content_height enabled can result in crash Aug 15, 2023
@kobligo
Copy link

kobligo commented Aug 30, 2023

I encountered the same problem while developing an editor plugin. As soon as any TextEdit node gets into a state where it would need to grow to fit the contained text, either by typing in it or by resizing the GUI, Godot as a whole just freezes.
The console prints nothing, but I can hear my CPU fan go wild due to the apparent infinite loop.

This bug makes it impossible for Godot to have editor plugins with dynamic GUI text contents, so somebody please look into this.

@ii4y-studios
Copy link

ii4y-studios commented Sep 1, 2023

I can confirm experiencing this on macOS as well, latest version on an M2 Macbook 24GB. What makes this significantly worse is a plugin automatically loading data and building UI at start, once hitting this limit, will create continuous crashes requiring the user to edit data outside of Godot to remove the offending data load

the plugin uses an await get_tree().process_frame as it builds the UI from the data it loads at the start to avoid UI locking as it builds, and once it hits this bug it hangs with the process frame never completing

@kitbdev
Copy link
Contributor

kitbdev commented Apr 25, 2024

Cannot reproduce in v4.2.1.stable.official [b09f793] or master (v4.3.dev.custom_build [11d3768])

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

7 participants