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

Debugger dies when inspecting a recursive property #54622

Open
Gnumaru opened this issue Nov 5, 2021 · 7 comments
Open

Debugger dies when inspecting a recursive property #54622

Gnumaru opened this issue Nov 5, 2021 · 7 comments

Comments

@Gnumaru
Copy link
Contributor

Gnumaru commented Nov 5, 2021

Godot version

3.3.4 standard build for linux x64

System information

Ubuntu 21.04 x64

Issue description

The gdscript debugger dies when stopping on a breakpoint in a location where the inspector should draw a class property that contains a recursive value. Eg.: A reference to self.

Steps to reproduce

  1. Create a new project
  2. Create an empty scene
  3. Attach a new script to the scene root node
  4. Use the code bellow on the script and run the scene.
var a
func _ready():
    a = self
    breakpoint

Minimal reproduction project

No response

@Gnumaru
Copy link
Contributor Author

Gnumaru commented Nov 5, 2021

I just noticed the same problem occur when creating a recursive meta property, even though neither the inspector tab nor the debugger tab draw the meta properties.

Using the code bellow yields the same result as the code above, that is, the debugger dies.

func _ready():
    get_script().set_meta('this', self)
    breakpoint

@sairam4123
Copy link

Can confirm, I was about to report it, related to #51049.

@akien-mga
Copy link
Member

Can you reproduce it in 3.4?

@Gnumaru
Copy link
Contributor Author

Gnumaru commented Nov 5, 2021

This:

var a
func _ready():
    a = self
    breakpoint

won't yield errors on 3.4. The debugger continues working normally.

But this:

func _ready():
    get_script().set_meta('this', self)
    breakpoint

altough won't kill the debugger, will make the console continuously spam the message:

ERROR: Condition "err" is true. Returned: err
   at: encode_variant (core/io/marshalls.cpp:1079)
ERROR: Condition "err" is true. Returned: err
   at: encode_variant (core/io/marshalls.cpp:1138)

The debugger won't die and you are still able to step through code, but since the console will be spamming the error messages, the editor performance degrades drastically.

@sairam4123
Copy link

sairam4123 commented Nov 6, 2021

It happens with this too.

func _ready():
	var d1 = {}
	var a1 = []
	d1["a"] = a1
	a1.push_back(d1)
	print(d1)
	breakpoint

Debugger dies in 3.4

lFC4Kv4iCg.mp4

@sairam4123
Copy link

sairam4123 commented Dec 31, 2021

Can confirm in 3.5.beta 7fcfde9. (Debugger crashes abruptly.)

@Calinou Calinou added this to the 3.5 milestone Dec 31, 2021
@miscbill
Copy link

miscbill commented Aug 25, 2023

Similarly, in v4.1.1.stable.official [bd6af8e]

func _ready():
	set_meta("foo", self)
	breakpoint

leads to...

E 0:00:01:0832 Node2D.gd:4 @ _ready(): Potential infinite recursion detected. Bailing.
<C++ Error> Condition "p_depth > Variant::MAX_RECURSION_DEPTH" is true. Returning: ERR_OUT_OF_MEMORY
<C++ Source> core/io/marshalls.cpp:1118 @ encode_variant()
Node2D.gd:4 @ _ready()

@KoBeWi KoBeWi modified the milestones: 3.5, 3.x Apr 23, 2024
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