-
Notifications
You must be signed in to change notification settings - Fork 788
[DeviceMSAN] Enable origin tracking #18693
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
base: sycl
Are you sure you want to change the base?
Conversation
unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_stackdepot.hpp
Show resolved
Hide resolved
Fixed, cpu device was enabled as well. |
Kindly ping @intel/unified-runtime-reviewers. Thanks! |
unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_utils.hpp
Show resolved
Hide resolved
@@ -63,38 +59,11 @@ ur_result_t EnqueueMemCopyRectHelper( | |||
// loop call 2D memory copy function to implement it. | |||
for (size_t i = 0; i < Region.depth; i++) { | |||
ur_event_handle_t NewEvent{}; | |||
UR_CALL(getContext()->urDdiTable.Enqueue.pfnUSMMemcpy2D( | |||
UR_CALL(msan::urEnqueueUSMMemcpy2D( |
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.
Just comment: using APIs from msan_ddi so that the shadow and origin can be copied automatically
clang/lib/Driver/SanitizerArgs.cpp
Outdated
@@ -1317,6 +1317,14 @@ void SanitizerArgs::addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args, | |||
|
|||
CmdArgs.push_back("-mllvm"); | |||
CmdArgs.push_back("-msan-poison-stack-with-call=1"); | |||
|
|||
if (MsanTrackOrigins) { | |||
assert(MsanTrackOrigins == 1 && |
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.
An assertion is pretty harsh for an invalid argument to a command line option. Can this be changed to use err_drv_argument_only_allowed_with
instead?
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.
Done
Enable origin tracking for host/shared/device USM, which can provide the more debug information about the detected uninitialized memory.