Avoid release memory from different dll#33993
Avoid release memory from different dll#33993sgbihu wants to merge 5 commits intoopenvinotoolkit:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses a memory leak issue (CVS-179009) by converting is_base_type_info from a concrete method to a pure virtual function. This ensures that type checking logic is executed within the same DLL/shared library where the object was created, preventing resource management issues across DLL boundaries.
Changes:
- Removed the concrete implementation of
is_base_type_infofromAny::Base - Made
is_base_type_infoa pure virtual function in the base class - Added override implementations in
RTTIAttributeandImplderived classes
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/core/src/any.cpp | Removed concrete implementation of is_base_type_info method |
| src/core/include/openvino/core/any.hpp | Converted is_base_type_info to pure virtual and added implementations in derived classes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
740c135 to
a5dbe12
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/core/include/openvino/core/any.hpp:1
- Changing a pure virtual function’s signature (from returning by value to returning by reference) is an ABI-breaking change for all derived implementations (vtable + override signature changes), which can break external plugins or applications that derive from
Any::Base. If ABI stability is required, prefer introducing a new virtual (e.g.,base_type_info_ref()returning a reference/view) while keeping the existingbase_type_info()by-value API (possibly implemented inBaseto copy from the ref-returning function), or otherwise ensure this change is gated behind an ABI/soname bump.
// Copyright (C) 2018-2026 Intel Corporation
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
14377a2 to
1c815d5
Compare
| struct TupleToTypeIndex<std::tuple<Args...>> { | ||
| static std::vector<std::type_index> get() { | ||
| return {typeid(Args)...}; | ||
| static const std::vector<std::type_index>& get() { |
There was a problem hiding this comment.
could it lead to dangling reference in the next scenario?
vector is created in onnxruntime_providers_openvino.dll. it is used inside of openvino.dll. onnxruntime_providers_openvino.dll is unloaded. There is a dangling ref inside openvino.dll
There was a problem hiding this comment.
The onnxruntime_providers_openvino.dll depends on openvino.dll, so this is an illegal use case.
|
build_jenkins |
Details:
openvino.dllreleased theonnxruntime_providers_openvino.dll's resource. And caused unexpected result.Tickets: