From 2dd1fb0d9aa6d8239b0cd73f859750b63e7d518c Mon Sep 17 00:00:00 2001 From: "Wu, Yingcong" Date: Thu, 29 Aug 2024 00:03:01 -0700 Subject: [PATCH 1/5] change ur tag --- sycl/cmake/modules/FetchUnifiedRuntime.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sycl/cmake/modules/FetchUnifiedRuntime.cmake b/sycl/cmake/modules/FetchUnifiedRuntime.cmake index 953b4851be7d9..f4b7041994118 100644 --- a/sycl/cmake/modules/FetchUnifiedRuntime.cmake +++ b/sycl/cmake/modules/FetchUnifiedRuntime.cmake @@ -125,6 +125,9 @@ if(SYCL_UR_USE_FETCH_CONTENT) # [XPTI] Use `ur.call` rather than `ur` in XPTI set(UNIFIED_RUNTIME_TAG d0a50523006fa6f283da6a36811081add3bb22fc) + set(UNIFIED_RUNTIME_REPO "https://github.com/yingcong-wu/unified-runtime.git") + set(UNIFIED_RUNTIME_TAG "yc/0827-asan-found_use-after-free") + set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES") # Due to the use of dependentloadflag and no installer for UMF and hwloc we need # to link statically on windows From d4363db3bd1f52a052a63b1d0eceea2d8d6360bf Mon Sep 17 00:00:00 2001 From: "Wu, Yingcong" Date: Wed, 4 Sep 2024 22:34:42 -0700 Subject: [PATCH 2/5] add test --- ...-zone-size.cpp => option-redzone-size.cpp} | 0 .../common/options-invalid.cpp | 39 +++++++++++++++++++ 2 files changed, 39 insertions(+) rename sycl/test-e2e/AddressSanitizer/common/{config-red-zone-size.cpp => option-redzone-size.cpp} (100%) create mode 100644 sycl/test-e2e/AddressSanitizer/common/options-invalid.cpp diff --git a/sycl/test-e2e/AddressSanitizer/common/config-red-zone-size.cpp b/sycl/test-e2e/AddressSanitizer/common/option-redzone-size.cpp similarity index 100% rename from sycl/test-e2e/AddressSanitizer/common/config-red-zone-size.cpp rename to sycl/test-e2e/AddressSanitizer/common/option-redzone-size.cpp diff --git a/sycl/test-e2e/AddressSanitizer/common/options-invalid.cpp b/sycl/test-e2e/AddressSanitizer/common/options-invalid.cpp new file mode 100644 index 0000000000000..4c3548886acec --- /dev/null +++ b/sycl/test-e2e/AddressSanitizer/common/options-invalid.cpp @@ -0,0 +1,39 @@ +// REQUIRES: linux +// RUN: %{build} %device_asan_flags -O0 -g -o %t +// RUN: %{run} %t + +// Invalid ur option format +// RUN: env UR_LAYER_ASAN_OPTIONS=a:1,b:1 %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVLAID-FORMAT +// INVLAID-FORMAT: [ERROR]: Wrong format of the UR_LAYER_ASAN_OPTIONS environment variable value + +// Invalid bool option +// RUN: env UR_LAYER_ASAN_OPTIONS=debug:yes %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVLAID-BOOL +// INVLAID-BOOL: [ERROR]: "debug" is set to "yes", which is not an valid setting. Acceptable input are: for enable, use: "1" "true"; for disable, use: "0" "false". + +// Invalid quarantine_size_mb +// RUN: env UR_LAYER_ASAN_OPTIONS=quarantine_size_mb:-1 %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVLAID-QUARANTINE +// RUN: env UR_LAYER_ASAN_OPTIONS=quarantine_size_mb:4294967296 %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVLAID-QUARANTINE +// INVLAID-QUARANTINE: [ERROR]: "quarantine_size_mb" should be an integer in range[0, 4294967295]. + +// Invalid redzone and max_redzone +// RUN: env UR_LAYER_ASAN_OPTIONS=redzone:abc %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVLAID-REDZONE +// INVLAID-REDZONE: [ERROR]: "redzone" should be an integer in range[0, 16]. +// RUN: env UR_LAYER_ASAN_OPTIONS=max_redzone:abc %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVLAID-MAXREDZONE +// INVLAID-MAXREDZONE: [ERROR]: "max_redzone" should be an integer in range[0, 2048]. + + + +#include + +int main() { + sycl::queue q; + constexpr std::size_t N = 8; + auto *array = sycl::malloc_device(N, q); + + q.submit([&](sycl::handler &h) { + h.single_task([=]() { ++array[0]; }); + }).wait(); + + sycl::free(array, q); + return 0; +} From cf4fe8152294b1399c052baf7bb6e73e6bb81947 Mon Sep 17 00:00:00 2001 From: "Wu, Yingcong" Date: Wed, 4 Sep 2024 22:36:33 -0700 Subject: [PATCH 3/5] update ur --- sycl/cmake/modules/FetchUnifiedRuntime.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/cmake/modules/FetchUnifiedRuntime.cmake b/sycl/cmake/modules/FetchUnifiedRuntime.cmake index f4b7041994118..831dfa0fee008 100644 --- a/sycl/cmake/modules/FetchUnifiedRuntime.cmake +++ b/sycl/cmake/modules/FetchUnifiedRuntime.cmake @@ -126,7 +126,7 @@ if(SYCL_UR_USE_FETCH_CONTENT) set(UNIFIED_RUNTIME_TAG d0a50523006fa6f283da6a36811081add3bb22fc) set(UNIFIED_RUNTIME_REPO "https://github.com/yingcong-wu/unified-runtime.git") - set(UNIFIED_RUNTIME_TAG "yc/0827-asan-found_use-after-free") + set(UNIFIED_RUNTIME_TAG "yc-0903-handle-option-exception") set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES") # Due to the use of dependentloadflag and no installer for UMF and hwloc we need From ffad52b3c5e84d83af10f1ee90c1def0011cd800 Mon Sep 17 00:00:00 2001 From: "Wu, Yingcong" Date: Mon, 23 Sep 2024 18:12:30 -0700 Subject: [PATCH 4/5] remove change of UR tag --- sycl/cmake/modules/FetchUnifiedRuntime.cmake | 3 --- 1 file changed, 3 deletions(-) diff --git a/sycl/cmake/modules/FetchUnifiedRuntime.cmake b/sycl/cmake/modules/FetchUnifiedRuntime.cmake index 831dfa0fee008..953b4851be7d9 100644 --- a/sycl/cmake/modules/FetchUnifiedRuntime.cmake +++ b/sycl/cmake/modules/FetchUnifiedRuntime.cmake @@ -125,9 +125,6 @@ if(SYCL_UR_USE_FETCH_CONTENT) # [XPTI] Use `ur.call` rather than `ur` in XPTI set(UNIFIED_RUNTIME_TAG d0a50523006fa6f283da6a36811081add3bb22fc) - set(UNIFIED_RUNTIME_REPO "https://github.com/yingcong-wu/unified-runtime.git") - set(UNIFIED_RUNTIME_TAG "yc-0903-handle-option-exception") - set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES") # Due to the use of dependentloadflag and no installer for UMF and hwloc we need # to link statically on windows From df42f6577a39085227adcb929ea5a899987e4d81 Mon Sep 17 00:00:00 2001 From: "Wu, Yingcong" Date: Mon, 23 Sep 2024 23:11:10 -0700 Subject: [PATCH 5/5] fix typo --- .../common/options-invalid.cpp | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sycl/test-e2e/AddressSanitizer/common/options-invalid.cpp b/sycl/test-e2e/AddressSanitizer/common/options-invalid.cpp index 4c3548886acec..a6e3ef21d0567 100644 --- a/sycl/test-e2e/AddressSanitizer/common/options-invalid.cpp +++ b/sycl/test-e2e/AddressSanitizer/common/options-invalid.cpp @@ -3,23 +3,23 @@ // RUN: %{run} %t // Invalid ur option format -// RUN: env UR_LAYER_ASAN_OPTIONS=a:1,b:1 %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVLAID-FORMAT -// INVLAID-FORMAT: [ERROR]: Wrong format of the UR_LAYER_ASAN_OPTIONS environment variable value +// RUN: env UR_LAYER_ASAN_OPTIONS=a:1,b:1 %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVALID-FORMAT +// INVALID-FORMAT: [ERROR]: Wrong format of the UR_LAYER_ASAN_OPTIONS environment variable value // Invalid bool option -// RUN: env UR_LAYER_ASAN_OPTIONS=debug:yes %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVLAID-BOOL -// INVLAID-BOOL: [ERROR]: "debug" is set to "yes", which is not an valid setting. Acceptable input are: for enable, use: "1" "true"; for disable, use: "0" "false". +// RUN: env UR_LAYER_ASAN_OPTIONS=debug:yes %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVALID-BOOL +// INVALID-BOOL: [ERROR]: "debug" is set to "yes", which is not an valid setting. Acceptable input are: for enable, use: "1" "true"; for disable, use: "0" "false". // Invalid quarantine_size_mb -// RUN: env UR_LAYER_ASAN_OPTIONS=quarantine_size_mb:-1 %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVLAID-QUARANTINE -// RUN: env UR_LAYER_ASAN_OPTIONS=quarantine_size_mb:4294967296 %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVLAID-QUARANTINE -// INVLAID-QUARANTINE: [ERROR]: "quarantine_size_mb" should be an integer in range[0, 4294967295]. +// RUN: env UR_LAYER_ASAN_OPTIONS=quarantine_size_mb:-1 %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVALID-QUARANTINE +// RUN: env UR_LAYER_ASAN_OPTIONS=quarantine_size_mb:4294967296 %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVALID-QUARANTINE +// INVALID-QUARANTINE: [ERROR]: "quarantine_size_mb" should be an integer in range[0, 4294967295]. // Invalid redzone and max_redzone -// RUN: env UR_LAYER_ASAN_OPTIONS=redzone:abc %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVLAID-REDZONE -// INVLAID-REDZONE: [ERROR]: "redzone" should be an integer in range[0, 16]. -// RUN: env UR_LAYER_ASAN_OPTIONS=max_redzone:abc %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVLAID-MAXREDZONE -// INVLAID-MAXREDZONE: [ERROR]: "max_redzone" should be an integer in range[0, 2048]. +// RUN: env UR_LAYER_ASAN_OPTIONS=redzone:abc %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVALID-REDZONE +// INVALID-REDZONE: [ERROR]: "redzone" should be an integer in range[0, 16]. +// RUN: env UR_LAYER_ASAN_OPTIONS=max_redzone:abc %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVALID-MAXREDZONE +// INVALID-MAXREDZONE: [ERROR]: "max_redzone" should be an integer in range[0, 2048].