-
Notifications
You must be signed in to change notification settings - Fork 597
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
cmd: add support for building with address and undefined behavior sanitizers #15059
base: master
Are you sure you want to change the base?
Conversation
Fri Feb 14 07:13:02 UTC 2025 Spread tests skipped |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #15059 +/- ##
=========================================
Coverage ? 78.06%
=========================================
Files ? 1181
Lines ? 157718
Branches ? 0
=========================================
Hits ? 123130
Misses ? 26942
Partials ? 7646
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
60354fc
to
d5010ec
Compare
d5010ec
to
a1b04d7
Compare
@@ -319,6 +319,20 @@ AS_IF([test "x$with_unit_tests" = "xyes"], [ | |||
AX_APPEND_COMPILE_FLAGS([-Werror], [CHECK_CFLAGS]) | |||
]) | |||
|
|||
AC_ARG_ENABLE([sanitize], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is only using asan at the moment, would it be better to just call it asan
rather than sanitize
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I think perhaps a better option name should be chosen that is more self-explanatory than just sanitize
(plus I expect woke
etc will complain about the use of the term sanitize
as well)
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. |
Signed-off-by: Maciej Borzecki <[email protected]>
Add support for building C code with address sanitizer (-fsanitize=address). Signed-off-by: Maciej Borzecki <[email protected]>
Signed-off-by: Maciej Borzecki <[email protected]>
Signed-off-by: Maciej Borzecki <[email protected]>
Signed-off-by: Maciej Borzecki <[email protected]>
Signed-off-by: Maciej Borzecki <[email protected]>
06d8368
to
12c286f
Compare
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().