Skip to content
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

Enable Leak Sanitizer and Undefined Behavior Sanitizer #45

Merged
merged 2 commits into from
Mar 15, 2020

Conversation

erenon
Copy link
Contributor

@erenon erenon commented Mar 12, 2020

See commit messages for details. Fixes #39

The ASAN_OPTION envvar is also inherited by child tests
launched by the IntegrationTest process and takes effect
(verified manually by adding new int(1) to Logging.cpp).

If the project is not compiled with ASAN, the extra envvar
is harmless.
Run UBSAN next to ASAN in GitHub ci.

cmake/UndefinedSanitizer.cmake
  The cmake check_cxx_compiler_flag seems to use a test
  that compiles with -fsanitized=undefined only,
  even if the platform also requires a statically linked ubsan lib:
  Prefer the statically linked lib, if available.

include/mserialize/detail/integer_to_hex.hpp
  Only with ubsan, the changed code is rejected by GCC,
  as shown in the comment. Perhaps a bug?
@@ -297,6 +299,7 @@ if(Boost_FOUND)

add_test(NAME IntegrationTest
COMMAND IntegrationTest --log_level=test_suite --color_output=true -- "$<TARGET_FILE:bread>" "$<TARGET_FILE_DIR:IntegrationTest>" "${PROJECT_SOURCE_DIR}")
set_property(TEST IntegrationTest PROPERTY ENVIRONMENT ASAN_OPTIONS=detect_leaks=1)

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#46

@erenon erenon merged commit d640225 into morganstanley:master Mar 15, 2020
@erenon erenon deleted the sanitizers branch March 15, 2020 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undefined and Leak Sanitisation
2 participants