-
Notifications
You must be signed in to change notification settings - Fork 784
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
Improve sanitizer support #1991
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Wow, I did not know that CMake 3.5 does not have the |
The SANITIZE_ADDRESS option of our CMake configuration activates the AddressSanitizer (and UBSan in a non-working way) for the whole project (although, by the way, its documentation pretends that it is only enabled for tests). This commit introduces new options SANITIZE_LEAK, SANITIZE_MEMORY, SANITIZE_UNDEFINED, SANITIZE_THREAD. Each of these options (including SANITIZE_ADDRESS) enables only the corresponding sanitizer. Moreover, we mark all sanitizer options as advanced options, because these options are only interesting for developers. Note that some sanitizers are conflicting, that is, not all options can be enabled simultaneously. Also, not all sanitizers are available for all compilers and versions. We, however, do not check for this, instead we let the compiler throw its errors in such cases. The explicit usage of the Google Linker is removed, because it is not necessary and can lead to problems with clang. The commit can be considered a rewrite of cmake/modules/SanitizerFlags.cmake. Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
The UndefinedBehaviorSanitizer includes the "vptr" check. This check, however, needs typeinfo for OCC::AccountManager because otherwise its stub for FileManTest leads to undefined references when linking. Adding the -frtti flag to enable run-time typeinfo did not solve the problem. I do not know another solution, so this commit disables the vptr check. Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
sbeyer
force-pushed
the
improve-sanitizer-support
branch
from
May 19, 2020 08:58
7e40812
to
7f598b1
Compare
er-vin
approved these changes
May 19, 2020
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.
Looks good to me
/backport to stable-2.6 |
The backport to stable-2.6 failed. Please do this backport manually. |
🍒 Cherry-picked to stable-2.6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for more sanitizers than only
AddressSanitizer
in the CMake configuration.