Re: [PATCH] Allocate extra 16 bytes for -fsanitize=address

2012-12-03 Thread Tom Tromey
> "Jakub" == Jakub Jelinek writes: Jakub> 2012-11-23 Jakub Jelinek Jakub> PR bootstrap/55380 Jakub> * files.c (read_file_guts): Allocate extra 16 bytes instead of Jakub> 1 byte at the end of buf. Pass size + 16 instead of size Jakub> to _cpp_convert_input. Jakub> * charset.c (_cpp_co

Re: [PATCH] Allocate extra 16 bytes for -fsanitize=address

2012-11-26 Thread H.J. Lu
On Fri, Nov 23, 2012 at 11:50 AM, Jakub Jelinek wrote: > On Fri, Nov 23, 2012 at 11:33:37AM -0800, H.J. Lu wrote: >> 2012-11-21 H.J. Lu >> >> PR bootstrap/55380 >> * charset.c (_cpp_convert_input): Clear CPP_PAD_BUFFER_SIZE >> bytes if CLEAR_CPP_PAD_BUFFER isn't 0. Allocate e

Re: [PATCH] Allocate extra 16 bytes for -fsanitize=address

2012-11-24 Thread Hans-Peter Nilsson
On Fri, 23 Nov 2012, H.J. Lu wrote: > On Fri, Nov 23, 2012 at 9:38 AM, Jakub Jelinek wrote: > > On Fri, Nov 23, 2012 at 09:23:37AM -0800, H.J. Lu wrote: > >> This patch allocates extra 16 bytes for -fsanitize=address so that > >> asan won't report read beyond memory buffer. It is used by > >> boot

Re: [PATCH] Allocate extra 16 bytes for -fsanitize=address

2012-11-23 Thread Jakub Jelinek
On Fri, Nov 23, 2012 at 11:33:37AM -0800, H.J. Lu wrote: > 2012-11-21 H.J. Lu > > PR bootstrap/55380 > * charset.c (_cpp_convert_input): Clear CPP_PAD_BUFFER_SIZE > bytes if CLEAR_CPP_PAD_BUFFER isn't 0. Allocate extra > CPP_PAD_BUFFER_SIZE bytes and clear it if CLEAR_C

Re: [PATCH] Allocate extra 16 bytes for -fsanitize=address

2012-11-23 Thread H.J. Lu
On Fri, Nov 23, 2012 at 11:23 AM, Uros Bizjak wrote: > On Fri, Nov 23, 2012 at 8:16 PM, H.J. Lu wrote: >> On Fri, Nov 23, 2012 at 10:59 AM, Uros Bizjak wrote: >>> Hello! >>> This patch allocates extra 16 bytes for -fsanitize=address so that asan won't report read beyond memory buffer.

Re: [PATCH] Allocate extra 16 bytes for -fsanitize=address

2012-11-23 Thread Uros Bizjak
On Fri, Nov 23, 2012 at 8:16 PM, H.J. Lu wrote: > On Fri, Nov 23, 2012 at 10:59 AM, Uros Bizjak wrote: >> Hello! >> >>> This patch allocates extra 16 bytes for -fsanitize=address so that >>> asan won't report read beyond memory buffer. It is used by >>> bootstrap-asan. OK to install? >> >>/*

Re: [PATCH] Allocate extra 16 bytes for -fsanitize=address

2012-11-23 Thread H.J. Lu
On Fri, Nov 23, 2012 at 10:59 AM, Uros Bizjak wrote: > Hello! > >> This patch allocates extra 16 bytes for -fsanitize=address so that >> asan won't report read beyond memory buffer. It is used by >> bootstrap-asan. OK to install? > >/* Resize buffer if we allocated substantially too much, or

Re: [PATCH] Allocate extra 16 bytes for -fsanitize=address

2012-11-23 Thread Uros Bizjak
Hello! > This patch allocates extra 16 bytes for -fsanitize=address so that > asan won't report read beyond memory buffer. It is used by > bootstrap-asan. OK to install? /* Resize buffer if we allocated substantially too much, or if we - haven't enough space for the \n-terminator. */ +

Re: [PATCH] Allocate extra 16 bytes for -fsanitize=address

2012-11-23 Thread H.J. Lu
On Fri, Nov 23, 2012 at 10:12 AM, Jakub Jelinek wrote: > On Fri, Nov 23, 2012 at 10:08:11AM -0800, H.J. Lu wrote: >> > to also change the caller, read_file_guts, where it does >> > buf = XNEWVEC (uchar, size + 1); >> > and >> > buf = XRESIZEVEC (uchar, buf, size + 1); >> >> I don't thi

Re: [PATCH] Allocate extra 16 bytes for -fsanitize=address

2012-11-23 Thread Jakub Jelinek
On Fri, Nov 23, 2012 at 10:08:11AM -0800, H.J. Lu wrote: > > to also change the caller, read_file_guts, where it does > > buf = XNEWVEC (uchar, size + 1); > > and > > buf = XRESIZEVEC (uchar, buf, size + 1); > > I don't think it is necessary since there is no real data in > those extra

Re: [PATCH] Allocate extra 16 bytes for -fsanitize=address

2012-11-23 Thread Konstantin Serebryany
On Fri, Nov 23, 2012 at 10:08 PM, H.J. Lu wrote: > On Fri, Nov 23, 2012 at 9:38 AM, Jakub Jelinek wrote: >> On Fri, Nov 23, 2012 at 09:23:37AM -0800, H.J. Lu wrote: >>> This patch allocates extra 16 bytes for -fsanitize=address so that >>> asan won't report read beyond memory buffer. It is used b

Re: [PATCH] Allocate extra 16 bytes for -fsanitize=address

2012-11-23 Thread H.J. Lu
On Fri, Nov 23, 2012 at 9:38 AM, Jakub Jelinek wrote: > On Fri, Nov 23, 2012 at 09:23:37AM -0800, H.J. Lu wrote: >> This patch allocates extra 16 bytes for -fsanitize=address so that >> asan won't report read beyond memory buffer. It is used by >> bootstrap-asan. OK to install? > > As valgrind wa

Re: [PATCH] Allocate extra 16 bytes for -fsanitize=address

2012-11-23 Thread Jakub Jelinek
On Fri, Nov 23, 2012 at 09:23:37AM -0800, H.J. Lu wrote: > This patch allocates extra 16 bytes for -fsanitize=address so that > asan won't report read beyond memory buffer. It is used by > bootstrap-asan. OK to install? As valgrind warns about that too, I'd say we should do that unconditionally,

[PATCH] Allocate extra 16 bytes for -fsanitize=address

2012-11-23 Thread H.J. Lu
Hi, This patch allocates extra 16 bytes for -fsanitize=address so that asan won't report read beyond memory buffer. It is used by bootstrap-asan. OK to install? Thanks. H.J. --- 2012-11-21 H.J. Lu PR bootstrap/55380 * charset.c (_cpp_convert_input): Allocate extra 16 bytes