cmd: add support for building with address and undefined behavior sanitizers
The branch builds on #15045 and adds support for building with asan and ubsan. This is only useful for testing local installation or running unit tests, as otherwise we'd have to ship libasan/libubsan in the snapd snap to make it universally useful in all scenarios.
Note, some binaries which are linked statically, snap-gdb*-shim specifically, had to be skipped, since libasan relies on dlopen().
Tue Feb 18 12:09:09 UTC 2025
Spread tests skipped
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 78.13%. Comparing base (
a272aac) to head (76dfa04). Report is 18 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #15059 +/- ##
==========================================
+ Coverage 78.07% 78.13% +0.06%
==========================================
Files 1182 1172 -10
Lines 157743 157622 -121
==========================================
+ Hits 123154 123156 +2
+ Misses 26943 26823 -120
+ Partials 7646 7643 -3
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 78.13% <ø> (+0.06%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
LGTM but I think perhaps a better option name should be chosen that is more self-explanatory than just
sanitize(plus I expectwokeetc will complain about the use of the termsanitizeas well)
Do you think it makes sense to add ubsan too, even if for unit tests only?
Do you think it makes sense to add ubsan too, even if for unit tests only?
Sure, the more the merrier particularly if its just the unit tests.