On Sun, May 8, 2016 at 10:03 AM, Amit Kumar <amit.s...@gmail.com> wrote:

> Hi,
> I am reviving this 3 years old thread. The good news is that address
> sanitizer is now officially supported by Apple in Xcode 7.
>
> Thanks everyone.
>
> Could it be a good idea to create a release build (highly optimized) in
> order to use with asan? I have created a debug build (all optimizations
> off) and it is working reasonably well with asan so I have no issues in
> using the debug build.
>

If performance of a debug build is ok for you, a highly optimized build
will not find anything new.
There are of course some exceptions, e.g. we once found a bug in the
optimizer itself with asan.
Or there could be bugs that depend on timing and don't trigger in debug
build.
Or some other kind of undefined behavior that will trigger a bug only in
optimized build and then will manifest as a memory corruption bug.


>
> I read on the asan page: "To get a reasonable performance add -O1 or
> higher."
> Does this imply that if performance is not an issue then disabling all
> optimizations (-O0) and creating a debug build may work the best?
>

Mostly yes. Although frankly I don't have much experience with using
asan+O0.
We always use it with O1 or O2.


>
> What is the optimization level used for chrome asan builds?
>

-O2.
In a large internal project we use -O1 but considering to migrate to -O2
due to better performance.



>
> Thanks,
> Amit
>
>
> On Tue, Oct 1, 2013 at 7:17 PM, Alexander Potapenko <
> ramosian.gli...@gmail.com> wrote:
>
>> Yes, right now you have to build Clang yourself. ASan isn't officially
>> supported by Apple, that's why it's disabled in Xcode.
>> See http://code.google.com/p/address-sanitizer/wiki/HowToBuild for the
>> build instructions. There's also pretty much information about using
>> the trunk Clang with Xcode on stackoverflow.com.
>>
>> On Tue, Oct 1, 2013 at 5:33 PM, Amit Kumar <amit.s...@gmail.com> wrote:
>> > I currently work on a product which has 200+ plugins and the code is
>> written
>> > in C++. This application works on both Mac and Windows. I have been
>> using
>> > Guard malloc to find memory related issues in this product. Guard
>> malloc has
>> > been very useful and it has found several issues in the codebase,
>> however,
>> > it also misses many issues. I have evaluated valgrind but that makes the
>> > application so slow that it is practically useless for our purpose.
>> > I was very much interested in evaluating address sanitizer. The problem
>> is
>> > that I am unable to use it.
>> >
>> > Earlier versions of Xcode used to support the flag -faddress-sanitizer,
>> > however even a basic cocoa application built using this used to crash.
>> In
>> > the newer versions of xcode, -faddress-sanitizer gives unsupported flag
>> > error. The newer way of specifying the flag -faddress=sanitize has
>> > apparently no effect.
>> > This is very discouraging for me that I am unable to use asan even with
>> a
>> > very simple cocoa application on mac.
>> > Do I need to build clang myself? Is there any hope that I will be able
>> to
>> > use asan on Mac.
>> > I have gone through the following link:
>> >
>> https://code.google.com/p/address-sanitizer/wiki/AddressSanitizerForMacImplementationDetails
>> >
>> > Thanks,
>> > Amit
>>
>
> --
> 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 address-sanitizer+unsubscr...@googlegroups.com.
> 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 address-sanitizer+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to