Skip to content

cmake: disable LeakSanitizer suppression output to fix CLI tests#65192

Merged
tchaikov merged 1 commit intoceph:mainfrom
tchaikov:wip-cmake-silence-lsan
Aug 30, 2025
Merged

cmake: disable LeakSanitizer suppression output to fix CLI tests#65192
tchaikov merged 1 commit intoceph:mainfrom
tchaikov:wip-cmake-silence-lsan

Conversation

@tchaikov
Copy link
Contributor

@tchaikov tchaikov commented Aug 23, 2025

LeakSanitizer prints matched suppressions by default, which causes CLI tests to fail when built with LSan enabled. The tests compare actual output against expected output, and the additional LSan messages break this comparison.

Example failure:

/home/jenkins-build/build/workspace/ceph-pull-requests/src/test/cli/ceph-kvstore-tool/help.t: failed
--- /home/jenkins-build/build/workspace/ceph-pull-requests/src/test/cli/ceph-kvstore-tool/help.t
+++ /home/jenkins-build/build/workspace/ceph-pull-requests/src/test/cli/ceph-kvstore-tool/help.t.err
@@ -21,3 +21,9 @@
     stats
     histogram [prefix]

+  -----------------------------------------------------
+  Suppressions used:
+    count      bytes template
+        1         45 ^MallocExtension::Initialize
+  -----------------------------------------------------
+

Set LSAN_OPTIONS=print_suppressions=0 to prevent this output rather than modifying test expectations, since the suppression messages are not part of the actual tool output and would vary between builds.

This change should fix run_cli_tests failures when building with LeakSanitizer

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

LeakSanitizer prints matched suppressions by default, which causes CLI
tests to fail when built with LSan enabled. The tests compare actual
output against expected output, and the additional LSan messages break
this comparison.

Example failure:

```
/home/jenkins-build/build/workspace/ceph-pull-requests/src/test/cli/ceph-kvstore-tool/help.t: failed
--- /home/jenkins-build/build/workspace/ceph-pull-requests/src/test/cli/ceph-kvstore-tool/help.t
+++ /home/jenkins-build/build/workspace/ceph-pull-requests/src/test/cli/ceph-kvstore-tool/help.t.err
@@ -21,3 +21,9 @@
     stats
     histogram [prefix]

+  -----------------------------------------------------
+  Suppressions used:
+    count      bytes template
+        1         45 ^MallocExtension::Initialize
+  -----------------------------------------------------
+
```

Set LSAN_OPTIONS=print_suppressions=0 to prevent this output rather
than modifying test expectations, since the suppression messages are
not part of the actual tool output and would vary between builds.

This change should fix run_cli_tests failures when building with LeakSanitizer

See https://github.com/google/sanitizers/wiki/SanitizerCommonFlags
for the environment variables respected by LeakSanitizer.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
@tchaikov tchaikov force-pushed the wip-cmake-silence-lsan branch from d186a84 to 65bede2 Compare August 23, 2025 07:55
@tchaikov tchaikov mentioned this pull request Aug 23, 2025
14 tasks
@tchaikov tchaikov requested a review from cbodley August 29, 2025 02:04
@tchaikov tchaikov merged commit 6744b65 into ceph:main Aug 30, 2025
19 of 22 checks passed
@tchaikov tchaikov deleted the wip-cmake-silence-lsan branch August 30, 2025 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants