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

GD-598: Memory leaks at cmd tool exit #598

Closed
MikeSchulze opened this issue Nov 20, 2024 · 0 comments · Fixed by #599
Closed

GD-598: Memory leaks at cmd tool exit #598

MikeSchulze opened this issue Nov 20, 2024 · 0 comments · Fixed by #599
Assignees
Labels
bug Something isn't working major
Milestone

Comments

@MikeSchulze
Copy link
Owner

The used GdUnit4 version

4.4.2 (Latest Release)

The used Godot version

v4.3.stable.mono.official [77dcf97d8]

Operating System

all

Describe the bug

When using the cmd tool, a lot of memory leaks are shown at exit.
Not all singletons are freed, it shows registered singletons GdUnit4CSharpApi, GdUnitThreadManager, GdUnitDefaultValueDecoders but only GdUnit4CSharpApi and GdUnitDefaultValueDecoders is freed.

So there is a bug in the singleton manager.

Exit code: 0
----------------------------------------------------------------
Cleanup singletons ["GdUnit4CSharpApi", "GdUnitThreadManager", "GdUnitDefaultValueDecoders"]

        Unregister singleton 'GdUnit4CSharpApi'
        Free singleton instance 'GdUnit4CSharpApi:<Object#95210702280>'
        Successfully freed 'GdUnit4CSharpApi'

        Unregister singleton 'GdUnitDefaultValueDecoders'
        Free singleton instance 'GdUnitDefaultValueDecoders:<Object#142170130109>'
        Successfully freed 'GdUnitDefaultValueDecoders'
----------------------------------------------------------------
Finallize .. done
Finallize ..
-Orphan nodes report-----------------------
Finallize .. done
Unloading: Disposing tracked instances...
Unloading: Finished disposing tracked instances.
XR: Clearing primary interface
XR: Removed interface "Native mobile"
XR: Removed interface "OpenXR"
WARNING: ObjectDB instances leaked at exit (run with --verbose for details).
     at: cleanup (core/object/object.cpp:2284)
Leaked instance: GDScriptNativeClass:9223372050679202456
Leaked instance: GDScriptNativeClass:9223372052793131798
Leaked instance: GDScript:9223372073932424523 - Resource path: res://addons/gdUnit4/src/core/thread/GdUnitThreadContext.gd
Leaked instance: GDScript:9223372074083419468 - Resource path: res://addons/gdUnit4/src/core/thread/GdUnitThreadManager.gd
Leaked instance: GDScript:9223372075140384081 - Resource path: res://addons/gdUnit4/src/core/GdUnitSignalCollector.gd
Leaked instance: GDScript:9223372075257824594 - Resource path: res://addons/gdUnit4/src/core/execution/GdUnitExecutionContext.gd
Leaked instance: GDScript:9223372089786893741 - Resource path: res://addons/gdUnit4/src/monitor/GodotGdErrorMonitor.gd
Leaked instance: GDScript:9223372090072106414 - Resource path: res://addons/gdUnit4/src/monitor/ErrorLogEntry.gd
Leaked instance: GDScript:9223372090457982383 - Resource path: res://addons/gdUnit4/src/monitor/GdUnitMonitor.gd
Leaked instance: Object:123480311248
Leaked instance: RefCounted:9223372228551247334
Leaked instance: RefCounted:9223372160368641520
Leaked instance: RefCounted:9223372160351864305
Leaked instance: RefCounted:9223372228349920886
Hint: Leaked instances typically happen when nodes are removed from the scene tree (with `remove_child()`) but not freed (with `free()` or `queue_free()`).
ERROR: 7 resources still in use at exit.
   at: clear (core/io/resource.cpp:599)
Resource still in use: res://addons/gdUnit4/src/core/thread/GdUnitThreadContext.gd (GDScript)
Resource still in use: res://addons/gdUnit4/src/core/thread/GdUnitThreadManager.gd (GDScript)
Resource still in use: res://addons/gdUnit4/src/core/GdUnitSignalCollector.gd (GDScript)
Resource still in use: res://addons/gdUnit4/src/core/execution/GdUnitExecutionContext.gd (GDScript)
Resource still in use: res://addons/gdUnit4/src/monitor/GodotGdErrorMonitor.gd (GDScript)
Resource still in use: res://addons/gdUnit4/src/monitor/ErrorLogEntry.gd (GDScript)
Resource still in use: res://addons/gdUnit4/src/monitor/GdUnitMonitor.gd (GDScript)
Orphan StringName: _register_thread (static: 0, total: 1)
Orphan StringName: _unregister_thread (static: 0, total: 1)
Orphan StringName: _report_collector (static: 0, total: 4)
Orphan StringName: get_test_suite_name (static: 0, total: 1)
Orphan StringName: get_assert (static: 0, total: 1)
Orphan StringName: _TestCase (static: 0, total: 1)
Orphan StringName: thread_id (static: 0, total: 1)
Orphan StringName: _is_report_push_errors (static: 0, total: 1)
Orphan StringName: _skipped_count (static: 0, total: 5)
Orphan StringName: _name (static: 0, total: 4)
Orphan StringName: _test_case_parameter_set (static: 0, total: 4)
Orphan StringName: get_execution_context_id (static: 0, total: 1)
Orphan StringName: stop (static: 0, total: 2)
Orphan StringName: _run (static: 0, total: 1)
Orphan StringName: _line (static: 0, total: 3)
Orphan StringName: _entries (static: 0, total: 4)
Orphan StringName: collect_teststage_orphan_reports (static: 0, total: 1)
Orphan StringName: instance (static: 0, total: 1)
Orphan StringName: get_test_suite_path (static: 0, total: 1)
Orphan StringName: PATTERN_PUSH_ERROR (static: 0, total: 1)
Orphan StringName: _details (static: 0, total: 3)
Orphan StringName: GdUnitThreadManager (static: 0, total: 2)
Orphan StringName: _setup_local_to_scene (static: 0, total: 7)
Orphan StringName: _on_signal_emmited (static: 0, total: 1)
Orphan StringName: @test_case_getter (static: 0, total: 1)
Orphan StringName: collect_testcase_orphan_reports (static: 0, total: 1)
Orphan StringName: NO_ARG (static: 0, total: 1)
Orphan StringName: GdUnitAssert (static: 0, total: 1)
Orphan StringName: error_monitor_stop (static: 0, total: 1)
Orphan StringName: has_errors (static: 0, total: 1)
Orphan StringName: error_monitor (static: 0, total: 5)
Orphan StringName: GdUnitTestSuite (static: 0, total: 1)
Orphan StringName: _debug_signal_list (static: 0, total: 1)
Orphan StringName: ErrorLogEntry (static: 0, total: 2)
Orphan StringName: reports (static: 0, total: 1)
Orphan StringName: _thread_id (static: 0, total: 4)
Orphan StringName: to_reports (static: 0, total: 1)
Orphan StringName: is_godot4x4 (static: 0, total: 1)
Orphan StringName: of_test_case (static: 0, total: 1)
Orphan StringName: start (static: 0, total: 2)
Orphan StringName: _thread_context_by_id (static: 0, total: 4)
Orphan StringName: register_emitter (static: 0, total: 1)
Orphan StringName: _godot_log_file (static: 0, total: 4)
Orphan StringName: _id (static: 0, total: 5)
Orphan StringName: dispose (static: 0, total: 2)
Orphan StringName: _has_errors (static: 0, total: 4)
Orphan StringName: _assert (static: 0, total: 4)
Orphan StringName: _parent_context (static: 0, total: 4)
Orphan StringName: GdUnitThreadContext (static: 0, total: 2)
Orphan StringName: GdUnitSignalCollector (static: 0, total: 3)
Orphan StringName: _get_current_context (static: 0, total: 1)
Orphan StringName: _sub_context (static: 0, total: 4)
Orphan StringName: test_suite (static: 0, total: 5)
Orphan StringName: Resource (static: 1, total: 2)
Orphan StringName: clear (static: 0, total: 1)
Orphan StringName: GodotGdErrorMonitor (static: 0, total: 3)
Orphan StringName: _to_string (static: 0, total: 1)
Orphan StringName: has_failures (static: 0, total: 1)
Orphan StringName: _flaky_test_retries (static: 0, total: 4)
Orphan StringName: gc (static: 0, total: 1)
Orphan StringName: id (static: 0, total: 1)
Orphan StringName: set_execution_context (static: 0, total: 1)
Orphan StringName: of_test_suite (static: 0, total: 1)
Orphan StringName: of (static: 0, total: 1)
Orphan StringName: LocalTime (static: 0, total: 1)
Orphan StringName: _test_case_name (static: 0, total: 4)
Orphan StringName: test_case (static: 0, total: 5)
Orphan StringName: extract_error (static: 0, total: 1)
Orphan StringName: GdUnitExecutionContext (static: 0, total: 4)
Orphan StringName: collect_reports (static: 0, total: 1)
Orphan StringName: GdUnitTestReportCollector (static: 0, total: 1)
Orphan StringName: extract_push_error (static: 0, total: 1)
Orphan StringName: is_success (static: 0, total: 1)
Orphan StringName: get_signal_collector (static: 0, total: 1)
Orphan StringName: of_parameterized_test (static: 0, total: 1)
Orphan StringName: Thread (static: 0, total: 2)
Orphan StringName: erase_log_entry (static: 0, total: 1)
Orphan StringName: _has_failures (static: 0, total: 4)
Orphan StringName: count_skipped (static: 0, total: 1)
Orphan StringName: _init (static: 0, total: 6)
Orphan StringName: has_warnings (static: 0, total: 1)
Orphan StringName: _extract (static: 0, total: 1)
Orphan StringName: count_failures (static: 0, total: 1)
Orphan StringName: get_current_context (static: 0, total: 1)
Orphan StringName: _collect_log_entries (static: 0, total: 1)
Orphan StringName: error_monitor_start (static: 0, total: 1)
Orphan StringName: match (static: 0, total: 1)
Orphan StringName: _collected_signals (static: 0, total: 4)
Orphan StringName: is_flaky (static: 0, total: 1)
Orphan StringName: _current_thread_id (static: 0, total: 5)
Orphan StringName: orphan_monitor_stop (static: 0, total: 1)
Orphan StringName: orphan_monitor_start (static: 0, total: 1)
Orphan StringName: is_interupted (static: 0, total: 1)
Orphan StringName: _timer (static: 0, total: 4)
Orphan StringName: GdUnitOrphanNodesMonitor (static: 0, total: 1)
Orphan StringName: TYPE (static: 0, total: 1)
Orphan StringName: _orphan_count (static: 0, total: 5)
Orphan StringName: run (static: 0, total: 1)
Orphan StringName: _has_warnings (static: 0, total: 4)
Orphan StringName: _flaky_test_check (static: 0, total: 4)
Orphan StringName: _error_count (static: 0, total: 5)
Orphan StringName: _regex_parse_error_line_number (static: 0, total: 1)
Orphan StringName: sum (static: 0, total: 1)
Orphan StringName: PATTERN_SCRIPT_ERROR (static: 0, total: 1)
Orphan StringName: PATTERN_4x4_SCRIPT_ERROR (static: 0, total: 1)
Orphan StringName: dispose_sub_contexts (static: 0, total: 1)
Orphan StringName: get_test_case_name (static: 0, total: 1)
Orphan StringName: SIGNAL_BLACK_LIST (static: 0, total: 1)
Orphan StringName: _is_success (static: 0, total: 4)
Orphan StringName: extract_push_warning (static: 0, total: 1)
Orphan StringName: count_errors (static: 0, total: 1)
Orphan StringName: collect_orphans (static: 0, total: 1)
Orphan StringName: get_execution_context (static: 0, total: 1)
Orphan StringName: Node (static: 1, total: 3)
Orphan StringName: @error_monitor_getter (static: 0, total: 1)
Orphan StringName: _is_report_script_errors (static: 0, total: 1)
Orphan StringName: count_orphans (static: 0, total: 1)
Orphan StringName: _orphan_monitor (static: 0, total: 4)
Orphan StringName: reset_received_signals (static: 0, total: 1)
Orphan StringName: _thread (static: 0, total: 4)
Orphan StringName: PATTERN_PUSH_WARNING (static: 0, total: 1)
Orphan StringName: _type (static: 0, total: 3)
Orphan StringName: PATTERN_4x4_PUSH_WARNING (static: 0, total: 1)
Orphan StringName: RefCounted (static: 2, total: 15)
Orphan StringName: GdUnitMonitor (static: 0, total: 2)
Orphan StringName: register_auto_free (static: 0, total: 1)
Orphan StringName: add_report (static: 0, total: 1)
Orphan StringName: _thread_name (static: 0, total: 4)
Orphan StringName: _is_calculated (static: 0, total: 5)
Orphan StringName: Object (static: 2, total: 3)
Orphan StringName: _memory_observer (static: 0, total: 4)
Orphan StringName: @test_suite_getter (static: 0, total: 1)
Orphan StringName: is_skipped (static: 0, total: 1)
Orphan StringName: _is_flaky (static: 0, total: 4)
Orphan StringName: is_signal_collecting (static: 0, total: 1)
Orphan StringName: scan (static: 0, total: 1)
Orphan StringName: _is_reporting_enabled (static: 0, total: 1)
Orphan StringName: unregister_emitter (static: 0, total: 1)
Orphan StringName: set_assert (static: 0, total: 1)
Orphan StringName: GdUnitMemoryObserver (static: 0, total: 1)
Orphan StringName: _to_report (static: 0, total: 1)
Orphan StringName: GdUnitTools (static: 0, total: 1)
Orphan StringName: _test_execution_iteration (static: 0, total: 5)
Orphan StringName: retry_execution (static: 0, total: 1)
Orphan StringName: _eof (static: 0, total: 4)
Orphan StringName: get_execution_statistics (static: 0, total: 1)
Orphan StringName: ErrorLogEntry.TYPE (static: 0, total: 1)
Orphan StringName: _report_enabled (static: 0, total: 5)
Orphan StringName: PATTERN_4x4_PUSH_ERROR (static: 0, total: 1)
Orphan StringName: _parse_error_line_number (static: 0, total: 1)
Orphan StringName: _message (static: 0, total: 3)
Orphan StringName: _failure_count (static: 0, total: 5)
Orphan StringName: evaluate_test_retry_status (static: 0, total: 1)
Orphan StringName: _signal_collector (static: 0, total: 4)
Orphan StringName: _execution_context (static: 0, total: 4)
Orphan StringName: build_reports (static: 0, total: 1)
Orphan StringName: _is_skipped (static: 0, total: 4)
StringName: 157 unclaimed string names at exit.

Steps to Reproduce

just run the tool with verbose option.
./addons/gdUnit4/runtest.sh --single-window --continue --add res://addons/gdUnit4/test/cmd/ --verbose

Minimal reproduction project

No response

@MikeSchulze MikeSchulze added the bug Something isn't working label Nov 20, 2024
@MikeSchulze MikeSchulze self-assigned this Nov 20, 2024
@MikeSchulze MikeSchulze added this to the 4.4.3 milestone Nov 20, 2024
@MikeSchulze MikeSchulze moved this to In Progress in GdUnit4 Nov 20, 2024
@MikeSchulze MikeSchulze changed the title GD-XXX: Memory leaks at cmd tool exit GD-598: Memory leaks at cmd tool exit Nov 21, 2024
@MikeSchulze MikeSchulze linked a pull request Nov 21, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from In Progress to Done in GdUnit4 Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working major
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant