Skip to content

Commit 747cd64

Browse files
AllanZynekbenzie
authored andcommitted
Fix e2e tests crashed on OpenCL CPU (#18150)
Unlike ASAN, MSAN needs "__devicelib_exit()" because if "j" is an uninitialized value in "data[j]", this will cause memory crash on CPU. But sometimes "__devicelib_exit()" will hang on OpenMP (GPU), so I added a new option "recover" to control it.
1 parent 779ced2 commit 747cd64

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

source/loader/layers/sanitizer/msan/msan_interceptor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ ur_result_t MsanInterceptor::prepareLaunch(
467467

468468
LaunchInfo.Data.Host.DeviceTy = DeviceInfo->Type;
469469
LaunchInfo.Data.Host.Debug = getContext()->Options.Debug ? 1 : 0;
470+
LaunchInfo.Data.Host.IsRecover = getContext()->Options.Recover ? 1 : 0;
470471

471472
// Clean shadow
472473
// Its content is always zero, and is used for unsupport memory types

source/loader/layers/sanitizer/sanitizer_common/sanitizer_options.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ void SanitizerOptions::Init(const std::string &EnvName,
4646
Parser.ParseBool("print_stats", PrintStats);
4747
Parser.ParseBool("detect_leaks", DetectLeaks);
4848
Parser.ParseBool("halt_on_error", HaltOnError);
49+
Parser.ParseBool("recover", Recover);
4950

5051
Parser.ParseUint64("quarantine_size_mb", MaxQuarantineSizeMB, 0, UINT32_MAX);
5152
Parser.ParseUint64("redzone", MinRZSize, 16);

source/loader/layers/sanitizer/sanitizer_common/sanitizer_options.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ struct SanitizerOptions {
3131
bool DetectKernelArguments = true;
3232
bool DetectLeaks = true;
3333
bool HaltOnError = true;
34+
bool Recover = false;
3435

3536
void Init(const std::string &EnvName, logger::Logger &Logger);
3637
};

0 commit comments

Comments
 (0)