Re: gcc addresssanitizer in MIPS

2013-10-30 Thread Jean Lee
I have tried Jakub patch listed in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58543. It works for my env. Thanks. 2013/10/29 Jean Lee : > Thanks. I will try Jakub patch listed in > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58543. > > 2013/10/29 Yury Gribov : >>> "copy_to_mode_reg (Pmode, XEXP

Re: gcc addresssanitizer in MIPS

2013-10-29 Thread Jean Lee
Thanks. I will try Jakub patch listed in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58543. 2013/10/29 Yury Gribov : >> "copy_to_mode_reg (Pmode, XEXP (shadow_mem, 0))" would be more direct. >> But it looks good to me with that change FWIW. > > Thanks, Richard. Note that Jakub has proposed an opti

Re: gcc addresssanitizer in MIPS

2013-10-29 Thread Yury Gribov
> "copy_to_mode_reg (Pmode, XEXP (shadow_mem, 0))" would be more direct. > But it looks good to me with that change FWIW. Thanks, Richard. Note that Jakub has proposed an optimized patch on gcc-patches ML (in Re: [PATCH] Invalid unpoisoning of stack redzones on ARM). -Y

Re: gcc addresssanitizer in MIPS

2013-10-29 Thread Richard Sandiford
Yury Gribov writes: > diff --git a/gcc/asan.c b/gcc/asan.c > index 32f1837..acb00ea 100644 > --- a/gcc/asan.c > +++ b/gcc/asan.c > @@ -895,7 +895,7 @@ asan_clear_shadow (rtx shadow_mem, HOST_WIDE_INT len) > >gcc_assert ((len & 3) == 0); >top_label = gen_label_rtx (); > - addr = force_re

Re: gcc addresssanitizer in MIPS

2013-10-29 Thread Yury Gribov
> Hi Yury, try to use the patch for asan.c to see if it solve your problem. I tried but unfortunately it did not work for me. Could you try the patch suggested in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58543 (I've attached it) when you have time? This was verified against gcc testsuite on

Re: gcc addresssanitizer in MIPS

2013-10-29 Thread Jean Lee
Hi Yury, try to use the patch for asan.c to see if it solve your problem. pinskia, thank you. I compiled asan with libssp which mean the stack grows down. I disassembled the compiled code and debuged the bin time to time before I thought it was a bug.early this month. I tried GCC 4.8.1 and GCC 4.9

Re: gcc addresssanitizer in MIPS

2013-10-28 Thread Yury Gribov
> Yes, we do see this error on ARM. Here is another instance of the same bug: http://permalink.gmane.org/gmane.comp.debugging.address-sanitizer/531 > Full description and suggested patch are available at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58543 > I'm curious whether suggested patch

Re: gcc addresssanitizer in MIPS

2013-10-28 Thread Yury Gribov
> Does someone use addresssanitizer in other platform (i386/x64/arm/ppc) > suffer this problem? Hi Jean, Yes, we do see this error on ARM. Full description and suggested patch are available at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58543 I'm curious whether suggested patch is going to wor

Re: gcc addresssanitizer in MIPS

2013-10-28 Thread pinskia
> On Oct 28, 2013, at 2:58 AM, Jean Lee wrote: > > Addresssanitizer was added to GCC since GCC 4.8, and you should > compile with the flag "-fsanitize=address". Moreover, the > addresssanitizer support for MIPS is not implemented in offical GCC. Yes I know that. I saying we back ported asan su

Re: gcc addresssanitizer in MIPS

2013-10-28 Thread Jean Lee
Addresssanitizer was added to GCC since GCC 4.8, and you should compile with the flag "-fsanitize=address". Moreover, the addresssanitizer support for MIPS is not implemented in offical GCC. Does someone use addresssanitizer in other platform (i386/x64/arm/ppc) suffer this problem? Thanks, Jean L

Re: gcc addresssanitizer in MIPS

2013-10-28 Thread pinskia
> On Oct 28, 2013, at 1:36 AM, Jean Lee wrote: > > My port of addresssanitizer is based on GCC 4.8.1. > I modify "asan_emit_stack_protection" function in gcc/asan.c for the > following reason: > Sometimes, the stack variable size > 32 Bytes, and after asan > generates code to poison the shadow b

gcc addresssanitizer in MIPS

2013-10-28 Thread Jean Lee
My port of addresssanitizer is based on GCC 4.8.1. I modify "asan_emit_stack_protection" function in gcc/asan.c for the following reason: Sometimes, the stack variable size > 32 Bytes, and after asan generates code to poison the shadow buffer, it does clear some shadow buffer but not all before fu