From c9b5adf083e3db82e1f64a5faa241211bbb0029e Mon Sep 17 00:00:00 2001 From: "Zhao, Maosu" Date: Wed, 26 Nov 2025 03:11:35 +0100 Subject: [PATCH] [DevSAN] Construct ProgramInfo even if program link failed Otherwise, we may meet problem when trying to release the program --- .../source/loader/layers/sanitizer/msan/msan_ddi.cpp | 2 ++ .../source/loader/layers/sanitizer/tsan/tsan_ddi.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp index 25d0307d8862b..6e3cca8490b2b 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp @@ -369,6 +369,7 @@ ur_result_t urProgramLink( if (UrRes != UR_RESULT_SUCCESS) { auto Devices = GetDevices(hContext); PrintUrBuildLogIfError(UrRes, *phProgram, Devices.data(), Devices.size()); + UR_CALL(getMsanInterceptor()->insertProgram(*phProgram)); return UrRes; } @@ -405,6 +406,7 @@ ur_result_t urProgramLinkExp( phPrograms, pOptions, phProgram); if (UrRes != UR_RESULT_SUCCESS) { PrintUrBuildLogIfError(UrRes, *phProgram, phDevices, numDevices); + UR_CALL(getMsanInterceptor()->insertProgram(*phProgram)); return UrRes; } diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp index 1172b741444cb..e03e82a62bb62 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp @@ -199,6 +199,7 @@ ur_result_t urProgramLink( if (UrRes != UR_RESULT_SUCCESS) { auto Devices = GetDevices(hContext); PrintUrBuildLogIfError(UrRes, *phProgram, Devices.data(), Devices.size()); + UR_CALL(getTsanInterceptor()->insertProgram(*phProgram)); return UrRes; } UR_CALL(getTsanInterceptor()->insertProgram(*phProgram)); @@ -364,6 +365,7 @@ ur_result_t urProgramLinkExp( phProgram); if (UrRes != UR_RESULT_SUCCESS) { PrintUrBuildLogIfError(UrRes, *phProgram, phDevices, numDevices); + UR_CALL(getTsanInterceptor()->insertProgram(*phProgram)); return UrRes; }