Skip to content

[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

Open
wants to merge 28 commits into
base: sycl
Choose a base branch
from

Conversation

AllanZyne
Copy link
Contributor

@AllanZyne AllanZyne commented May 28, 2025

Enable origin tracking for host/shared/device USM, which can provide the more debug information about the detected uninitialized memory.

@AllanZyne AllanZyne marked this pull request as ready for review June 17, 2025 01:47
@AllanZyne AllanZyne requested review from a team as code owners June 17, 2025 01:47
@AllanZyne AllanZyne requested a review from steffenlarsen June 17, 2025 01:47
@zhaomaosu zhaomaosu requested a review from Copilot June 17, 2025 01:51
Copilot

This comment was marked as outdated.

@AllanZyne
Copy link
Contributor Author

Sorry for missing this one! The SYCL E2E tests look reasonable, though I am, like @yingcong-wu, a little concerned about the disabling of cpu testing as a whole. Since this is 3 weeks old, do we have a timeframe for a fix to it?

Fixed, cpu device was enabled as well.

@AllanZyne
Copy link
Contributor Author

Kindly ping @intel/unified-runtime-reviewers. Thanks!

@AllanZyne AllanZyne requested a review from a team as a code owner June 20, 2025 10:00
@@ -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(
Copy link
Contributor Author

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

@@ -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 &&
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants