Skip to content

Use -fsanitize=address,undefined in debug builds on CI #9397

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 1 commit into from
Mar 19, 2025

Conversation

swolchok
Copy link
Contributor

These sanitizers help catch bugs. AIUI, they only affect a few unittest jobs.

[ghstack-poisoned]
@swolchok
Copy link
Contributor Author

swolchok commented Mar 19, 2025

Stack from ghstack (oldest at bottom):

Copy link

pytorch-bot bot commented Mar 19, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/9397

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 New Failures, 1 Unrelated Failure

As of commit 75d3886 with merge base 01a22b6 (image):

NEW FAILURES - The following jobs have failed:

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 19, 2025
swolchok added a commit that referenced this pull request Mar 19, 2025
These sanitizers help catch bugs. AIUI, they only affect a few unittest jobs.

ghstack-source-id: cd1285f
ghstack-comment-id: 2737438678
Pull Request resolved: #9397
@mergennachin
Copy link
Contributor

Great idea. On top of asan and ubsan, it'd be great to have tsan too, especially with thread pool enabled.

But you can't enable all three at the same time. You might have to have a dedicated tsan job version (with thread pool enabled) for the unittest.

@@ -111,9 +111,14 @@ build_executorch_runner_cmake() {
mkdir "${CMAKE_OUTPUT_DIR}"

pushd "${CMAKE_OUTPUT_DIR}" || return
if [[ $1 == "Debug" ]]; then
CXXFLAGS="-fsanitize=address,undefined"
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't you want CXXFLAGS="-fsanitize=address,undefined -g"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if I'm not mistaken, CXXFLAGS merely adds to the flags. I will check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I checked and -g is still present (and there appear to be no other optimization/debug flags added in CMAKE_BUILD_TYPE=Debug)

@swolchok swolchok added the release notes: build Changes related to build, including dependency upgrades, build flags, optimizations, etc. label Mar 19, 2025
@swolchok
Copy link
Contributor Author

it'd be great to have tsan too,

that one needs to go on the backlog, I haven't got time right now and I suspect we have extant-but-benign TSAN problems

@swolchok
Copy link
Contributor Author

unittest-release failure is a known flake. test-arm-backend-delegation has been having problems lately and is unlikely to be unlikely broken by this change. merging.

@swolchok swolchok merged commit a5d64cf into main Mar 19, 2025
167 of 171 checks passed
@swolchok swolchok deleted the gh/swolchok/384/head branch March 19, 2025 19:44
oscarandersson8218 pushed a commit to oscarandersson8218/executorch that referenced this pull request Mar 21, 2025
These sanitizers help catch bugs. AIUI, they only affect a few unittest
jobs.
DannyYuyang-quic pushed a commit to CodeLinaro/executorch that referenced this pull request Apr 2, 2025
These sanitizers help catch bugs. AIUI, they only affect a few unittest
jobs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: build Changes related to build, including dependency upgrades, build flags, optimizations, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants