Skip to content

GGVbox / GGHbox infinite loop crash #3

@cpazzra

Description

@cpazzra

The issue:

I have a UI component that I'm trying to both:

  • align child labels vertically and horizontally
  • shrink the contents to fix the child labels

As such, I tried setting both nodes to "Shrink to fit".
However, when starting to assign the second component (can happen in either direction, vbox or hbox first), this seems to trigger an infinite loop in the "_resolve_size" calculations, before forcing the application to close due to being out of memory with this error:

Failed method: Control::_update_minimum_size. Message queue out of memory. Message queue out of memory. Try increasing 'memory/limits/message_queue/max_size_mb' in project settings.
Object was deleted while awaiting a callback.
Object was deleted while awaiting a callback.
Object was deleted while awaiting a callback.
ERROR: Parameter "_p" is null.
   at: _unref (core/variant/dictionary.cpp:356)
   GDScript backtrace (most recent call first):
       [0] _resolve_component_size (res://addons/GameGUI/GGComponent.gd:451)
       [1] _resolve_child_size (res://addons/GameGUI/GGComponent.gd:384)
       [2] _resolve_child_sizes (res://addons/GameGUI/GGVBox.gd:29)
       [3] _resolve_size (res://addons/GameGUI/GGComponent.gd:491)
       [4] _resolve_child_size (res://addons/GameGUI/GGComponent.gd:382)
       [5] _resolve_child_sizes (res://addons/GameGUI/GGComponent.gd:317)
       [6] _resolve_size (res://addons/GameGUI/GGComponent.gd:491)
       [7] _resolve_child_size (res://addons/GameGUI/GGComponent.gd:382)
       [8] _resolve_child_sizes (res://addons/GameGUI/GGComponent.gd:317)
       [9] _resolve_size (res://addons/GameGUI/GGComponent.gd:491)
       [10] _update_layout (res://addons/GameGUI/GGComponent.gd:503)
       [11] _on_sort_children (res://addons/GameGUI/GGComponent.gd:572

Would need to poke around to discover a hypothetical fix for this.

How to reproduce

Fairly simple. Have a GGHbox inside a GGVbox or vice versa and try to set both layout modes to "Shrink to fit".
The application will hang before crashing when setting the second node's layout.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions