Skip to content

Commit 4d0dc14

Browse files
committed
report misalign access
1 parent 4f13cd1 commit 4d0dc14

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

source/loader/layers/sanitizer/asan_interceptor.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,10 +414,11 @@ ur_result_t SanitizerInterceptor::postLaunchKernel(ur_kernel_handle_t Kernel,
414414
}
415415
if (AH.ErrorType == DeviceSanitizerErrorType::USE_AFTER_FREE) {
416416
ReportUseAfterFree(AH, Kernel, GetContext(Queue));
417-
} else if (AH.ErrorType == DeviceSanitizerErrorType::OUT_OF_BOUNDS) {
418-
ReportOutOfBoundsError(AH, Kernel);
417+
} else if (AH.ErrorType == DeviceSanitizerErrorType::OUT_OF_BOUNDS ||
418+
AH.ErrorType == DeviceSanitizerErrorType::MISALIGNED) {
419+
ReportGenericError(AH, Kernel);
419420
} else {
420-
ReportGenericError(AH);
421+
ReportFatalError(AH);
421422
}
422423
}
423424

source/loader/layers/sanitizer/asan_report.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ void ReportDoubleFree(uptr Addr, const StackTrace &Stack,
8181
exit(1);
8282
}
8383

84-
void ReportGenericError(const DeviceSanitizerReport &Report) {
84+
void ReportFatalError(const DeviceSanitizerReport &Report) {
8585
context.logger.always("\n====ERROR: DeviceSanitizer: {}",
8686
ToString(Report.ErrorType));
8787
exit(1);
8888
}
8989

90-
void ReportOutOfBoundsError(const DeviceSanitizerReport &Report,
91-
ur_kernel_handle_t Kernel) {
90+
void ReportGenericError(const DeviceSanitizerReport &Report,
91+
ur_kernel_handle_t Kernel) {
9292
const char *File = Report.File[0] ? Report.File : "<unknown file>";
9393
const char *Func = Report.Func[0] ? Report.Func : "<unknown func>";
9494
auto KernelName = GetKernelName(Kernel);

source/loader/layers/sanitizer/asan_report.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ void ReportBadContext(uptr Addr, const StackTrace &stack,
3131
void ReportDoubleFree(uptr Addr, const StackTrace &Stack,
3232
const std::shared_ptr<AllocInfo> &AllocInfo);
3333

34-
void ReportGenericError(const DeviceSanitizerReport &Report);
34+
// This type of error is usually unexpected mistake and doesn't have enough debug information
35+
void ReportFatalError(const DeviceSanitizerReport &Report);
3536

36-
void ReportOutOfBoundsError(const DeviceSanitizerReport &Report,
37-
ur_kernel_handle_t Kernel);
37+
void ReportGenericError(const DeviceSanitizerReport &Report,
38+
ur_kernel_handle_t Kernel);
3839

3940
void ReportUseAfterFree(const DeviceSanitizerReport &Report,
4041
ur_kernel_handle_t Kernel, ur_context_handle_t Context);

0 commit comments

Comments
 (0)