Skip to content

Add sanitizers job - #57

Open
bratpiorka wants to merge 1 commit into
oneapi-src:mainfrom
bratpiorka:rrudnick_rustc_flags
Open

bratpiorka wants to merge 1 commit into
oneapi-src:mainfrom
bratpiorka:rrudnick_rustc_flags

Conversation

@bratpiorka

Copy link
Copy Markdown
Contributor

Add a new sanitizers job that builds and tests the project using Rust nightly with hardening flags and runs tests with AddressSanitizer and LeakSanitizer enabled. The job is configured to run only on CPU devices to avoid compatibility issues with GPU drivers and sanitizers.

@szymon-zadworny szymon-zadworny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm but I have some concerns regarding OpenCL runtime leak suppression. Also - this job takes the longest to complete. This is probably caused by having to install the nightly toolchain, but it's also worth checking whether all the sanitizer flags (e.g. fast_unwind_on_malloc) are actually necessary.

Image

ASAN_OPTIONS: fast_unwind_on_malloc=0
LSAN_OPTIONS: suppressions=${{ github.workspace }}/.github/lsan-suppressions.txt:fast_unwind_on_malloc=0
run: |
for sanitizer in address leak; do

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

env:
# Test only CPU to avoid issues with GPU drivers and sanitizers
ONEAPI_DEVICE_SELECTOR: opencl:cpu
ASAN_OPTIONS: fast_unwind_on_malloc=0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need to disable fast unwind?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I might be wrong on this but if the OpenCL runtime manages all allocations then all SYCL-related leaks will happen inside the runtime. If we suppress this then we won't get any leak reports caused by wrong runtime usage by the C++ shims/Rust bindings.

This branch has not been deployed

No deployments
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.

2 participants