-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Add -fsanitizer=address for debug builds in travis #2653
Conversation
TheMarex
commented
Jul 13, 2016
•
edited
Loading
edited
- Fix osrm-extract triggers the address sanitizer #2788
- Figure out why https://travis-ci.org/Project-OSRM/osrm-backend/jobs/153525916 is using the sanitizer
- Review
- Address comments.
@@ -54,6 +54,7 @@ option(ENABLE_ASSERTIONS OFF) | |||
option(COVERAGE OFF) | |||
option(SANITIZER OFF) | |||
option(ENABLE_LTO "Use LTO if available" ON) | |||
option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF) |
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.
Instead of hardcoding options for asan / msan / tsan / ubsan / ... it's probably cleaner to just set the env var
CXXFLAGS=-fsanitize=X
and let CMake pick it up automatically.
77d4e27
to
4418102
Compare
4418102
to
61fa142
Compare
This fails because |
0f7fa0f
to
3ea4cc4
Compare
3ea4cc4
to
47d064c
Compare
47d064c
to
102491f
Compare
We are currently hitting http://stackoverflow.com/questions/37603238/fsanitize-not-using-gold-linker-in-gcc-6-1 with GCC. Switching to clang now and see if that works. |
32e337a
to
b57eb27
Compare
@TheMarex the problem was in linking example without gold against OSRM libraries built with gold. It is only ubuntu gcc 6.1 issue. gcc 6.2 works fine. I have committed to my repository https://github.com/oxidase/osrm-backend/tree/build/add-sanitize to avoid forced push to upstream. There were 2 problems:
If it looks ok, i can squash commits and push into upstream. |
@oxidase thanks for looking into this! 👍 I added some comments on your branch. You can pull in the changes here if you think my comments are resolved. |
b57eb27
to
834fca0
Compare
The issue /usr/bin/ld: unrecognized option '--push-state' is due to missing '-fuse-ld=gold' in the example that is built with gcc-6.2 from the toolchain PPA and ld 2.24 from trusty that are not fully compatible. There is a problem with binutils 2.24 that do not support the option introduced by asan. I have added a binutils PPA that bumps version to 2.27 for the debug asan build. It can be removed when binutils in the toolchain PPA will be updated to at least 2.26 or travis will switch to xenial. |
@oxidase thanks for looking into this again. Great to see this working finally. 💯 I'm going to do the following things here:
If we wait for #3015 the shared memory fixes are obsolete anyway since the whole ownership mode got reworked. |
834fca0
to
b2958da
Compare
b2958da
to
cf3dfcd
Compare