Re: Leak sanitizer not working with optimisations enabled

2019-02-14 Thread Ankur Raj
Thanks a lot Yuri for replying ! I am not so familiar with assembly and when i try to look into assembly code generated from both optimisation its not clear to me I am pasting assembly code for main function below (for -O1and -O0) , could you please point me exactly what is happening ? here With

Re: Leak sanitizer not working with optimisations enabled

2019-02-14 Thread Yuri Gribov
Hi Ankur, If pointer to allocated buffer manages to survive in one of the registers or on stack (after program returns from main), LSan would consider buffer to be reachable and won't report it. This behavior is very sensitive to compiler/Glibc version and compilation flags. On 2/15/19, Ankur Raj

Leak sanitizer not working with optimisations enabled

2019-02-14 Thread Ankur Raj
Hi Folks , Wondering if someone can explain this Adress sanitizer does not report and leak in this code below when compiled with O1 , O2 ,,, But it works as expected when compiled with O0 #include #include int main () { volatile char *str; /* Initial memory allocation */ str = (ch