Skip to content

[GHA] [Sanitizers] Transformations func tests show leaks#34758

Open
praasz wants to merge 6 commits intoopenvinotoolkit:masterfrom
praasz:bugfix/gha-func-tests-show-leaks
Open

[GHA] [Sanitizers] Transformations func tests show leaks#34758
praasz wants to merge 6 commits intoopenvinotoolkit:masterfrom
praasz:bugfix/gha-func-tests-show-leaks

Conversation

@praasz
Copy link
Contributor

@praasz praasz commented Mar 18, 2026

Details:

  • Fix model validation in topological sort when exception throw force unlink nodes to removed dependencies (circular) which allow release nodes without leak.

Tickets:

AI Assistance:

  • AI assistance used: yes
  • Support analyze sanitizers errors to identify issues

@praasz praasz requested a review from a team as a code owner March 18, 2026 10:33
@github-actions github-actions bot added category: Core OpenVINO Core (aka ngraph) category: CPP API OpenVINO CPP API bindings labels Mar 18, 2026
@praasz praasz requested a review from CuriousPanCake March 18, 2026 10:42
@praasz praasz added this to the 2026.2 milestone Mar 18, 2026
@mlukasze mlukasze requested a review from Copilot March 18, 2026 10:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes sanitizer-reported leaks triggered when model validation/topological sort detects cycles by explicitly breaking circular dependencies before throwing, and updates several core tests to avoid leaking allocations/nodes when exceptions occur.

Changes:

  • Break node argument/control-dependency links on loop detection in topological_sort to allow reference cycles to be released before throwing.
  • Add/adjust regression tests that construct cyclic graphs and assert ov::Model creation throws (covering 1-node and 2-node loops, plus a cycle created via output replacement).
  • Update a few unit tests to properly own/deallocate allocated resources (allocator aligned allocation; opset create() results).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/core/include/openvino/core/graph_util.hpp On loop detection, disconnects node inputs/control deps before throwing to prevent leaks from cycles.
src/core/src/descriptor/input.cpp Simplifies m_src_node assignment when replacing outputs.
src/core/tests/model.cpp Adds a 2-node cycle regression test for model construction/topological sort throwing.
src/core/tests/node_input_output.cpp Wraps tests in ov::test namespace and adds a cyclic-model construction throw test to ensure no leaks.
src/core/tests/ov_default_allocator_test.cpp Ensures aligned allocation test also deallocates the returned pointer.
src/core/tests/conditional_compilation/ov_cc_on.cpp Wraps OpSet::create*() raw pointers in shared_ptr to avoid test leaks.
src/core/tests/conditional_compilation/ov_cc_off.cpp Same as above for the “cc off” variant.
src/core/tests/conditional_compilation/ov_cc_collect.cpp Same as above for the “collect” variant.

praasz added 2 commits March 18, 2026 14:58
Signed-off-by: Pawel Raasz <pawel.raasz@intel.com>
Signed-off-by: Pawel Raasz <pawel.raasz@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: Core OpenVINO Core (aka ngraph) category: CPP API OpenVINO CPP API bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants