-
Notifications
You must be signed in to change notification settings - Fork 738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SYCL][DeviceSanitizer] Checking "sycl::free" related errors #12882
[SYCL][DeviceSanitizer] Checking "sycl::free" related errors #12882
Conversation
@intel/unified-runtime-reviewers who is the right person to do the merge? We need to merge this PR for Aurora deliverable asap. Thanks. |
@xtian-github the process is described here: https://github.com/intel/llvm/blob/sycl/CONTRIBUTING.md#merge We still need an approval from @intel/unified-runtime-reviewers. |
h.single_task<class MyKernel>([=]() { *array = 0; }); | ||
}); | ||
Q.wait(); | ||
// CHECK-DEBUG: [kernel] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is used to test UR_LAYER_ASAN_OPTIONS=debug:1
runtime flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And what is it supposed to be, exactly? Imagine someone not familiar with sanitizer implementation reading this test, what could they find?
Are you even sure this single line should be tested at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, array
leaks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And what is it supposed to be, exactly? Imagine someone not familiar with sanitizer implementation reading this test, what could they find?
In fact, it's used to print debug message in libdevice (you can see "__AsanDebug" in "libdevice/sanitizer_utils.cpp").
Are you even sure this single line should be tested at all?
Makes sense.
Currently, UR_LAYER_ASAN_OPTIONS=debug:1
is more useful for us (sanitizer developers).
Besides, we're going to remove some of messages in release build for performance.
Okay, I'll remove this test!
@@ -0,0 +1,17 @@ | |||
// REQUIRES: linux, cpu | |||
// RUN: %{build} %device_sanitizer_flags -O2 -g -o %t | |||
// RUN: env SYCL_PREFER_UR=1 UR_LAYER_ASAN_OPTIONS=debug:1 %{run} %t 2>&1 | FileCheck --check-prefixes CHECK-DEBUG %s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does it work without UR_ENABLE_LAYERS=UR_LAYER_ASAN
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UR_ENABLE_LAYERS=UR_LAYER_ASAN
is used to forcedly enable ASan Layer in UR loader, which is the runtime support for device sanitizer.
We enable UR_LAYER_ASAN automatically by checking kernel image property.
But some tests don't have any kernel, so I have to enable UR_LAYER_ASAN manually.
Our users are unlikely to need enable device ASan without any kernel, I think it's fine to just use this flag for tests.
We need to merge oneapi-src/unified-runtime#1402 first, its next in line. Once that's in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UR LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I'll address them asap. Thanks! |
…flags", add "force_device_asan_rt"
fb83bfc
to
b9c0aed
Compare
It seems like that the CI test failure is not related to this PR. |
@intel/llvm-gatekeepers please merge |
Hi @intel/llvm-gatekeepers, all comments have been addressed, please merge. Thanks! |
UR: oneapi-src/unified-runtime#1402
This PR added supports for checking the following types of error in "UR_LAYER_ASAN":
I added the environment variable "UR_LAYER_ASAN_OPTIONS" to have additional control over "UR_LAYER_ASAN", which is similar to "ASAN_OPTIONS" in ASan. Currently, it supports:
For example, to enable "use-after-free" with 5MB quarantine cache and debug message in kernel, you need to
UR_LAYER_ASAN_OPTIONS="quarantine_size_mb:5;debug:1" ./sycl_app