Skip to content

Commit d02c47a

Browse files
authored
[DevASAN][DevMSAN] Use abort instead of exit when in error (#19085)
When we try to exit the problem when reporting the error, the `exit(1)` could cause hangs in SYCL runtime because it skips some processes before the SYCL shutdown process in atexit stage. The `abort()` is more accurate here because it would stop the whole process right away, and no more SYCL shutdown process with the unstable, early exited program.
1 parent fb071ab commit d02c47a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ class AsanInterceptor {
345345

346346
void exitWithErrors() {
347347
m_NormalExit = false;
348-
exit(1);
348+
std::abort();
349349
}
350350

351351
bool isNormalExit() { return m_NormalExit; }

unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ class MsanInterceptor {
327327

328328
void exitWithErrors() {
329329
m_NormalExit = false;
330-
exit(1);
330+
std::abort();
331331
}
332332

333333
bool isNormalExit() { return m_NormalExit; }

0 commit comments

Comments
 (0)