Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/loader/layers/sanitizer/asan_interceptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ ContextInfo::~ContextInfo() {
getContext()->urDdiTable.Context.pfnRelease(Handle);
assert(Result == UR_RESULT_SUCCESS);

if (getOptions().DetectLeaks) {
if (getContext()->interceptor->getOptions().DetectLeaks) {
// check memory leaks
std::vector<AllocationIterator> AllocInfos =
getContext()->interceptor->findAllocInfoByContext(Handle);
Expand Down
3 changes: 1 addition & 2 deletions source/loader/layers/sanitizer/asan_interceptor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ class SanitizerInterceptor {
std::shared_ptr<DeviceInfo> &DeviceInfo);

private:
AsanOptions m_Options;
Copy link
Contributor

Choose a reason for hiding this comment

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

unnecessary changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a needed change because we need to make sure AsanOptions destucts after ContextInfo so that we can use it in the ~ContextInfo().

std::unordered_map<ur_context_handle_t, std::shared_ptr<ContextInfo>>
m_ContextMap;
ur_shared_mutex m_ContextMapMutex;
Expand All @@ -316,8 +317,6 @@ class SanitizerInterceptor {

std::unique_ptr<Quarantine> m_Quarantine;

AsanOptions m_Options;

std::unordered_set<ur_adapter_handle_t> m_Adapters;
ur_shared_mutex m_AdaptersMutex;
};
Expand Down
Loading