One thing to avoid is -O0 (fully disabled optimizations) where asan will be
too slow.
If I had to choose one configuration I would go with "-fsanitize=address -g
-fno-omit-frame-pointers"
and -O1 or -O2 w/o any other flags, especially without -D_NDEBUG which
disables assertions.
The choice between -O1 and -O2 should be based on performance -- use -O1 if
it's fast enough for you, otherwise use -O2

hth,

--kcc

On Wed, Apr 10, 2019 at 4:08 PM <[email protected]> wrote:

> Is it better to have all the optimization in place that a release build
> does vs. a debug build?
>
> We ship release builds however our ASAN and production builds use
> different compilers so we already have optimization differences between the
> two builds.
>
> I saw in the FAQ (
> https://github.com/google/sanitizers/wiki/AddressSanitizer) somebody had
> a known problem that wasn't detected and the statement was maybe it was
> optimized out.
>
>    -
>
>    Q: Why didn't ASan report an obviously invalid memory access in my
>    code?
>    -
>
>    A1: If your errors is too obvious, compiler might have already
>    optimized it out by the time Asan runs.
>
> If that is really the case I would prefer a debug build so issues are
> fixed in both release and debug.
>
> If you had to pick one build type which would you use to find the most
> issues?
>
> --
> You received this message because you are subscribed to the Google Groups
> "address-sanitizer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"address-sanitizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to