Skip to content

[SYCL][E2E] Hack AddressSanitizer/.../device_global.cpp to pass CI #16865

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 2 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
// REQUIRES: linux, cpu || (gpu && level_zero)

// The following is an ugly hack to make CI pass. The issue here is that when
// sycl-toolchain is built with assertions enabled, then we hit one at
// `DeviceGlobalUSMMem::~DeviceGlobalUSMMem()` and exit with abort. If not, then
// sanitizer does `exit(1)`.
//
// That doesn't matter as long as LIT does *not* use "external shell", but when
// it does, the difference between `not` and `not --crash` becomes crucial and
// we cannot have a single command that would match both behaviors. Ideally,
// we'd need to make a choice based on how the toolchain was built.
// Unfortunately, we don't have that information at the LIT level and
// propagating it all the way down to it would be ugly. Instead, rely on the
// fact that "no-assertion" mode doesn't use "run-only" lit invocations and make
// a choice based on that. This is rather fragile but workarounds the issue for
// the time being.

// DEFINE: %{not} = not %if test-mode-run-only %{ --crash %}

// RUN: %{build} %device_asan_flags -O0 -g -o %t1.out
// RUN: %{run} not --crash %t1.out 2>&1 | FileCheck %s
// RUN: %{run} %{not} %t1.out 2>&1 | FileCheck %s
// RUN: %{build} %device_asan_flags -O1 -g -o %t2.out
// RUN: %{run} not --crash %t2.out 2>&1 | FileCheck %s
// RUN: %{run} %{not} %t2.out 2>&1 | FileCheck %s
// RUN: %{build} %device_asan_flags -O2 -g -o %t3.out
// RUN: %{run} not --crash %t3.out 2>&1 | FileCheck %s
// RUN: %{run} %{not} %t3.out 2>&1 | FileCheck %s

// Flakily timesout on PVC
// UNSUPPORTED: arch-intel_gpu_pvc
Expand Down
4 changes: 4 additions & 0 deletions sycl/test-e2e/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
config.available_features.add("build-and-run-mode")
elif config.test_mode == "run-only":
lit_config.note("run-only test mode enabled, only executing tests")
# run-only uses external shell, some tests might have hacks to workaround
# failures caused by that.
config.available_features.add("test-mode-run-only")

config.available_features.add("run-mode")
if lit_config.params.get("fallback-to-build-if-requires-build-and-run", False):
config.available_features.add("build-and-run-mode")
Expand Down
Loading