Skip to content

[DeviceAddressSanitizer] Add warning for unaligned __asan_mem_to_shadow call #18879

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

Merged
merged 4 commits into from
Jun 11, 2025

Conversation

yingcong-wu
Copy link
Contributor

@yingcong-wu yingcong-wu commented Jun 10, 2025

And skip some test affected by OpenCL CPU subgroup buffer alignment issue.

This PR addresses #18743.

@yingcong-wu yingcong-wu requested a review from a team as a code owner June 10, 2025 07:12
@yingcong-wu yingcong-wu changed the title add check [DeviceAddressSanitizer] Add warning for unaligned __asan_mem_to_shadow call Jun 10, 2025
@yingcong-wu
Copy link
Contributor Author

Failure looks like infrastructure problem.

@yingcong-wu yingcong-wu requested a review from Copilot June 10, 2025 11:48
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR skips certain AddressSanitizer tests on OpenCL CPU devices at -O0 due to subgroup alignment issues, and adds a runtime warning when __asan_mem_to_shadow() is called with an unaligned pointer.

  • Introduce %if !cpu guards to skip O0 tests on OpenCL CPU in three SYCL test files.
  • Add a static warning message and __spirv_ocl_printf call in __asan_mem_to_shadow for unaligned addresses.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
sycl/test-e2e/AddressSanitizer/out-of-bounds/local/group_local_memory_func.cpp Skip O0 test run on CPU targets
sycl/test-e2e/AddressSanitizer/out-of-bounds/local/group_local_memory.cpp Skip O0 test run on CPU targets
sycl/test-e2e/AddressSanitizer/out-of-bounds/buffer/buffer_3d.cpp Skip O0 test run on CPU targets; added O2 run step
libdevice/sanitizer/asan_rtl.cpp Added unaligned-address warning in __asan_mem_to_shadow
Comments suppressed due to low confidence (2)

sycl/test-e2e/AddressSanitizer/out-of-bounds/local/group_local_memory_func.cpp:7

  • After building the O2 variant, a corresponding // RUN: not %t3.out 2>&1 | FileCheck %s step is missing, so the O2 test case isn’t exercised.
// RUN: %{build} %device_asan_flags -g -O2 -o %t3.out

sycl/test-e2e/AddressSanitizer/out-of-bounds/local/group_local_memory.cpp:7

  • The O2 build is added but there’s no // RUN: not %t3.out 2>&1 | FileCheck %s invocation, so test coverage for -O2 is absent.
// RUN: %{build} %device_asan_flags -g -O2 -o %t3.out

@yingcong-wu
Copy link
Contributor Author

Hi @intel/llvm-gatekeepers , this PR is ready to merge, thanks.

@steffenlarsen steffenlarsen merged commit 503494f into intel:sycl Jun 11, 2025
24 checks passed
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.

3 participants