bug - access attempt to released memory #739
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On the UGW platform, a SIGSEGV event is sent to a prplmesh application
that utilizes the easylogging++ library. The event is sent due to an
access attempt to a released memory. The released memory is a pointer
to the "LogStreamsReferenceMap m_logStreamsReference" which is defined
statically in RegisteredLoggers class.
The RegisteredLoggers object is released in UGW before the release of
other Class objects that make use of the pointer, and thus - the pointer is accessed
after the map is already released.
The issue may be seen in other platforms and is dependent on the difference in object release order.
After this change, the map is defined as a shared-pointer in the RegisteredLoggers class
and is set to a shared-pointer of type LogStreamsReferenceMap in the RegisteredLoggers CTOR. Even if the RegisteredLoggers object is released, the map resource will be
available to the rest of the objects until all are destructed.
This is a
I have
CHANGELOG.md
README.md
Fixes #738