Details
-
Bug
-
Status: Resolved
-
Not specified
-
Resolution: Fixed
-
None
-
None
Description
The metric code uses
std::shared_ptr<IMetric>
but they are created as
std::shared_ptr<CounterMetric>
However IMetric does not have a virtual destructor which means the objects will not be cleaned up properly (undefined behaviour). It may be the cause of the recent crashes we have seen.
I'm also not 100% clear whether the following is completely legal
std::shared_ptr<base> x = std::shared_ptr<derived>
Does it use the same shared_ptr? Is it cleaned up properly. It compiles without problem, so I suspect it is ok - provided base has a virtual destructor.
Attachments
Issue Links
- is cloned by
-
HPCC-27452 Crash when processing metrics constructor
-
- New
-