You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A3: If _FORTIFY_SOURCE is enabled, ASan may have false positives, see next question.
Q: I've compiled my code with -D_FORTIFY_SOURCE flag and ASan, or -D_FORTIFY_SOURCE is enabled by default in my distribution (most modern distributions). Now ASan misbehaves (either produces false warnings, or does not find some bugs).
A: Currently ASan (and other sanitizers) doesn't support source fortification, see google/sanitizers#247. The fix should most likely be on the glibc side, see the (stalled) discussion here.
However, adding the following options doesn't help either since it's defined in the CROSSTOOL it seems:
build:asan --copt="-U_FORTIFY_SOURCE"
Feature requests: what underlying problem are you trying to solve with this feature?
Use asan on osx.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Run a C++ build with the following arg:
--copt="-fsanitize=address"
What operating system are you running Bazel on?
osx
What's the output of bazel info release?
release 0.19.0
Have you found anything relevant by searching the web?
Description of the problem / feature request:
-D_FORTIFY_SOURCE=1is enabled by default on OSX. This break when trying to use asan.When running a build with
-fsanitize=address, the build outputs warnings with:However, according to https://github.com/google/sanitizers/wiki/AddressSanitizer,
_FORTIFY_SOURCEshould be disabled when using asan.However, adding the following options doesn't help either since it's defined in the CROSSTOOL it seems:
Feature requests: what underlying problem are you trying to solve with this feature?
Use asan on osx.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Run a C++ build with the following arg:
What operating system are you running Bazel on?
osx
What's the output of
bazel info release?Have you found anything relevant by searching the web?
I can submit a PR if everybody approves me of removing it by default.
I'm also noticing it is enabled by default on linux.
We managed to get around using the following configuration: