You can play with these flags to reduce heap overheads:

ASAN_FLAG(
    bool, poison_heap, true,
    "Poison (or not) the heap memory on [de]allocation. Zero value is
useful "
    "for benchmarking the allocator or instrumentator.")
ASAN_FLAG(
    int, max_malloc_fill_size, 0x1000,  // By default, fill only the first
4K.
    "ASan allocator flag. max_malloc_fill_size is the maximal amount of "
    "bytes that will be filled with malloc_fill_byte on malloc.")
ASAN_FLAG(int, max_redzone, 2048,
          "Maximal size (in bytes) of redzones around heap objects.")
ASAN_FLAG(int, quarantine_size_mb, -1,
          "Size (in Mb) of quarantine used to detect use-after-free "
          "errors. Lower value may reduce memory usage but increase the "
          "chance of false negatives.")
ASAN_FLAG(int, thread_local_quarantine_size_kb, -1,
          "Size (in Kb) of thread local quarantine used to detect "
          "use-after-free errors. Lower value may reduce memory usage but "
          "increase the chance of false negatives. It is not advised to go "
          "lower than 64Kb, otherwise frequent transfers to global
quarantine "
          "might affect performance.")






On Thu, Jun 22, 2017 at 11:53 AM, Alexander Potapenko <
ramosian.gli...@gmail.com> wrote:

> This is more or less expected.
> As Kuba said, there's no distinction between a check for a heap overflow
> or global overflow - we just check that every memory access is valid.
>
> On Thu, Jun 22, 2017 at 9:08 AM, Aayushi Agrawal <aayushigr...@gmail.com>
> wrote:
>
>> Yes I tried but its coming out to be almost same.
>>
>> Slowdown is almost 2 times.
>>
>> On Wed, Jun 21, 2017 at 9:28 PM, Kuba Mracek <mra...@apple.com> wrote:
>>
>>> How big is the slowdown?  Did you try using ASan with higher
>>> optimization levels (-O1, -O2, -O3)?
>>>
>>> At the point where ASan instruments memory reads and writes, it doesn't
>>> know whether the destination is a stack variable, a global variable or a
>>> pointer to the heap.  So I don't think there's a way of selectively only
>>> instrumenting stack and/or globals.
>>>
>>> Kuba
>>>
>>> On 21 Jun 2017, at 04:11, Aayushi Agrawal <aayushigr...@gmail.com>
>>> wrote:
>>>
>>> Hello
>>>
>>> I used " -fsanitise=address " as one of the option for compiling my
>>> program with clang.
>>> But it slows down the execution of the program.
>>>
>>> Can anybody please tell me that is there a way to only check the stack
>>> variables overflow, global variables overflow and avoid all other checks
>>> using ASAN which could help in improving the execution speed?
>>>
>>>
>>> --
>>> 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.
>>>
>>>
>>>
>>
>>
>> --
>> Aayushi Agrawal
>> B.Tech(Final Year)
>> Computer Science Engineering Undergraduate
>> LNMIIT,JAIPUR
>> Contact - 09649357639
>>
>> --
>> 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.
>

-- 
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