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

GDScript debugger crashes the instant a doubly linked list is made using a Dictionary. #34512

Closed
SamuelNewhouse opened this issue Dec 21, 2019 · 3 comments
Labels

Comments

@SamuelNewhouse
Copy link

Godot version:
v3.1.1.stable.official

OS/device including version:
Windows 10 Home, Version 1809, OS Build 17763.914

Issue description:
If run normally the game will not crash, but stepping through the code with the GDScript debugger causes the debugger to crash the instant a doubly linked list is made using a Dictionary. The moment the list is linked both forwards and backwards, the debugger crashes.

Steps to reproduce:

  1. Use a dictionary with "next" and "previous" keys as a structure for a doubly linked list.
  2. Use a loop inside _ready() to create the doubly linked list.
  3. Run the game and it will not crash.
  4. Step through code with the debugger and it will crash on the second loop when "previous" is assigned to the first list item.

Minimal reproduction project:
Doubly Linked.zip

@Zylann
Copy link
Contributor

Zylann commented Dec 21, 2019

A doubly-linked list in GDScript calls for reference cycles (as in a graph). Item 1 references item 0, item 0 references item 1. The debugger may be fixed to not crash in this case, but you still have a memory leak problem.
To workaround this:

  • Change your list items to derive from Object (if they don't already), but take care freeing them after use
  • Or have your items in a separate array, and store indexes to that array in your list items

@SamuelNewhouse
Copy link
Author

Thanks Zylann. I created a new listItem derived from Object and it no longer crashes when stepping through the code.

@bojidar-bg
Copy link
Contributor

Duplicate of #1289.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants