Skip to content

Commit eaf7e47

Browse files
committed
remove abnormal exit
1 parent 861d3aa commit eaf7e47

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

source/loader/layers/sanitizer/asan_interceptor.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ ur_result_t enqueueMemSetShadow(ur_context_handle_t Context,
146146

147147
} // namespace
148148

149-
bool SanitizerInterceptor::AbnormalExit = false;
150-
151149
SanitizerInterceptor::SanitizerInterceptor(logger::Logger &logger)
152150
: logger(logger) {
153151
if (Options(logger).MaxQuarantineSizeMB) {
@@ -160,10 +158,6 @@ SanitizerInterceptor::SanitizerInterceptor(logger::Logger &logger)
160158
SanitizerInterceptor::~SanitizerInterceptor() {
161159
DestroyShadowMemoryOnCPU();
162160
DestroyShadowMemoryOnPVC();
163-
164-
if (AbnormalExit) {
165-
exit(1);
166-
}
167161
}
168162

169163
/// The memory chunk allocated from the underlying allocator looks like this:
@@ -899,20 +893,14 @@ ContextInfo::~ContextInfo() {
899893
getContext()->urDdiTable.Context.pfnRelease(Handle);
900894
assert(Result == UR_RESULT_SUCCESS);
901895

902-
bool HasLeak = false;
903896
std::vector<AllocationIterator> AllocInfos =
904897
getContext()->interceptor->findAllocInfoByContext(Handle);
905898
for (const auto &It : AllocInfos) {
906899
const auto &[_, AI] = *It;
907-
if (AI->IsReleased) {
900+
if (!AI->IsReleased) {
908901
ReportMemoryLeak(AI);
909-
HasLeak = true;
910902
}
911903
}
912-
913-
if (HasLeak) {
914-
SanitizerInterceptor::AbnormalExit = true;
915-
}
916904
}
917905

918906
ur_result_t USMLaunchInfo::initialize() {

source/loader/layers/sanitizer/asan_interceptor.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,6 @@ struct DeviceGlobalInfo {
165165

166166
class SanitizerInterceptor {
167167
public:
168-
static bool AbnormalExit;
169-
170168
explicit SanitizerInterceptor(logger::Logger &logger);
171169

172170
~SanitizerInterceptor();

0 commit comments

Comments
 (0)