Skip to content

Commit e792e79

Browse files
authored
Revert "[DeviceASAN] Fix throw "UR_RESULT_ERROR_INVALID_ARGUMENT" exception when catching free related error"
1 parent 7e38d0a commit e792e79

File tree

3 files changed

+4
-18
lines changed

3 files changed

+4
-18
lines changed

source/loader/layers/sanitizer/asan/asan_interceptor.cpp

+4-16
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,7 @@ ur_result_t AsanInterceptor::releaseMemory(ur_context_handle_t Context,
175175
if (!AllocInfoItOp) {
176176
// "Addr" might be a host pointer
177177
ReportBadFree(Addr, GetCurrentBacktrace(), nullptr);
178-
if (getOptions().HaltOnError) {
179-
exitWithErrors();
180-
}
181-
return UR_RESULT_SUCCESS;
178+
return UR_RESULT_ERROR_INVALID_ARGUMENT;
182179
}
183180

184181
auto AllocInfoIt = *AllocInfoItOp;
@@ -193,26 +190,17 @@ ur_result_t AsanInterceptor::releaseMemory(ur_context_handle_t Context,
193190
// "Addr" might be a host pointer
194191
ReportBadFree(Addr, GetCurrentBacktrace(), nullptr);
195192
}
196-
if (getOptions().HaltOnError) {
197-
exitWithErrors();
198-
}
199-
return UR_RESULT_SUCCESS;
193+
return UR_RESULT_ERROR_INVALID_ARGUMENT;
200194
}
201195

202196
if (Addr != AllocInfo->UserBegin) {
203197
ReportBadFree(Addr, GetCurrentBacktrace(), AllocInfo);
204-
if (getOptions().HaltOnError) {
205-
exitWithErrors();
206-
}
207-
return UR_RESULT_SUCCESS;
198+
return UR_RESULT_ERROR_INVALID_ARGUMENT;
208199
}
209200

210201
if (AllocInfo->IsReleased) {
211202
ReportDoubleFree(Addr, GetCurrentBacktrace(), AllocInfo);
212-
if (getOptions().HaltOnError) {
213-
exitWithErrors();
214-
}
215-
return UR_RESULT_SUCCESS;
203+
return UR_RESULT_ERROR_INVALID_ARGUMENT;
216204
}
217205

218206
AllocInfo->IsReleased = true;

source/loader/layers/sanitizer/asan/asan_options.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ AsanOptions::AsanOptions() {
9090
SetBoolOption("detect_privates", DetectPrivates);
9191
SetBoolOption("print_stats", PrintStats);
9292
SetBoolOption("detect_leaks", DetectLeaks);
93-
SetBoolOption("halt_on_error", HaltOnError);
9493

9594
auto KV = OptionsEnvMap->find("quarantine_size_mb");
9695
if (KV != OptionsEnvMap->end()) {

source/loader/layers/sanitizer/asan/asan_options.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ struct AsanOptions {
2828
bool PrintStats = false;
2929
bool DetectKernelArguments = true;
3030
bool DetectLeaks = true;
31-
bool HaltOnError = true;
3231

3332
explicit AsanOptions();
3433
};

0 commit comments

Comments
 (0)