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

bug - access attempt to released memory #739

Merged
merged 1 commit into from
Dec 25, 2020
Merged

Conversation

adam1985d
Copy link
Contributor

@adam1985d adam1985d commented Jan 28, 2020

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

  • Breaking change
  • New feature
  • Bugfix

I have

Fixes #738

On the UGW platform, a SIGSEGV event is sent to the APM 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 is not seen in other platforms due to difference in GCC which
results in a 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 reasouce will be
available to rest of objects until all are destructed.

Signed-off-by: Adam Dov <adamx.dov@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug - access attempt to released memory
2 participants