Re: [PATCH][libsanitizer] Cherry-pick r211008 [Was: Re: libsanitizer merge from upstream r208536]

2014-06-23 Thread Jakub Jelinek
On Mon, Jun 23, 2014 at 07:23:09PM +0200, Paolo Carlini wrote: > / > 2014-06-23 Paolo Carlini > > * sanitizer_common/sanitizer_common_interceptors.inc: > Cherry pick upstream r211008. Sure, thanks. > Index: sanitizer_common/sanitizer_common_interceptors.inc >

[PATCH][libsanitizer] Cherry-pick r211008 [Was: Re: libsanitizer merge from upstream r208536]

2014-06-23 Thread Paolo Carlini
Hi, On 06/16/2014 10:42 AM, Konstantin Serebryany wrote: On Wed, Jun 11, 2014 at 2:28 PM, Paolo Carlini wrote: Hi, On 05/22/2014 09:02 PM, Jakub Jelinek wrote: In file included from ../../../../trunk/libsanitizer/asan/asan_interceptors.cc:147:0: ../../../../trunk/libsanitizer/sanitizer_comm

Re: libsanitizer merge from upstream r208536

2014-06-16 Thread Paolo Carlini
Hi, On 16/06/14 10:42, Konstantin Serebryany wrote: I've "fixed" this in upstream trunk: http://llvm.org/viewvc/llvm-project?view=revision&revision=211008 This will get into GCC with the next merge; or feel free to cherry pick. Excellent thanks a lot. Meanwhile, this still smells like a bug in

Re: libsanitizer merge from upstream r208536

2014-06-16 Thread Konstantin Serebryany
On Wed, Jun 11, 2014 at 2:28 PM, Paolo Carlini wrote: > Hi, > > On 05/22/2014 09:02 PM, Jakub Jelinek wrote: >> >> In file included from >> ../../../../trunk/libsanitizer/asan/asan_interceptors.cc:147:0: >> >> ../../../../trunk/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc: >> In

Re: libsanitizer merge from upstream r208536

2014-06-11 Thread Paolo Carlini
Hi, On 05/22/2014 09:02 PM, Jakub Jelinek wrote: In file included from ../../../../trunk/libsanitizer/asan/asan_interceptors.cc:147:0: ../../../../trunk/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc: In function ‘int __interceptor_accept4(int, void*, unsigned int*, int)’: ../..

Re: libsanitizer merge from upstream r208536

2014-05-30 Thread Dodji Seketeli
Jakub Jelinek writes: [...] > Here is the GCC side of the thing, [...] > 2014-05-23 Jakub Jelinek > > * asan.c (report_error_func): Add SLOW_P argument, use > BUILT_IN_ASAN_*_N if set. > (build_check_stmt): Likewise. > (instrument_derefs): If T has insufficient ali

Re: libsanitizer merge from upstream r208536

2014-05-30 Thread Dodji Seketeli
Jakub Jelinek writes: > On Thu, May 22, 2014 at 04:07:38PM +0200, Jakub Jelinek wrote: >> 2014-05-22 Jakub Jelinek >> >> * sanitizer.def (BUILT_IN_ASAN_REPORT_LOAD_N, >> BUILT_IN_ASAN_REPORT_STORE_N): New. >> * asan.c (struct asan_mem_ref): Change access_size type to >> HO

Re: libsanitizer merge from upstream r208536

2014-05-30 Thread Dodji Seketeli
Jakub Jelinek writes: [...] > Ok, tried to merge also g++.dg/asan from the same revision as you've merged > libsanitizer. [...] > > 2014-05-22 Jakub Jelinek > > * g++.dg/asan/asan_test.C: Add -std=c++11 and > -DSANITIZER_USE_DEJAGNU_GTEST=1 to dg-options, remove > -DASAN_U

Re: libsanitizer merge from upstream r208536

2014-05-28 Thread Dmitry Vyukov
On Wed, May 28, 2014 at 8:36 AM, Konstantin Serebryany wrote: > Dmitry, > You've introduced atomic_uint64_t stats_[AllocatorStatCount]; in > http://llvm.org/viewvc/llvm-project?view=revision&revision=173332 > Do you mind to change it to atomic_uintptr_t? > There is of course a chance of overflow

Re: libsanitizer merge from upstream r208536

2014-05-28 Thread Jakub Jelinek
On Tue, May 27, 2014 at 05:04:52PM -0500, Peter Bergner wrote: > On Tue, 2014-05-27 at 23:50 +0200, Jakub Jelinek wrote: > > On Tue, May 27, 2014 at 04:02:08PM -0500, Peter Bergner wrote: > > > It's being called form basically two files: > > > > > > [bergner@makalu-lp1 gcc-fsf-mainline-asan-debug]

Re: libsanitizer merge from upstream r208536

2014-05-27 Thread Konstantin Serebryany
Dmitry, You've introduced atomic_uint64_t stats_[AllocatorStatCount]; in http://llvm.org/viewvc/llvm-project?view=revision&revision=173332 Do you mind to change it to atomic_uintptr_t? There is of course a chance of overflow on 32-bit arch (the number of mallocs in a process may easily go over 2^

Re: libsanitizer merge from upstream r208536

2014-05-27 Thread Ramana Radhakrishnan
On Tue, May 27, 2014 at 11:00 PM, Jakub Jelinek wrote: > On Tue, May 27, 2014 at 11:50:33PM +0200, Jakub Jelinek wrote: >> On Tue, May 27, 2014 at 04:02:08PM -0500, Peter Bergner wrote: >> > It's being called form basically two files: >> > >> > [bergner@makalu-lp1 gcc-fsf-mainline-asan-debug]$ fin

Re: libsanitizer merge from upstream r208536

2014-05-27 Thread Peter Bergner
On Tue, 2014-05-27 at 17:04 -0500, Peter Bergner wrote: > On Tue, 2014-05-27 at 23:50 +0200, Jakub Jelinek wrote: > > Does ppc32 have any atomic 64-bit loads/stores (in the sense that the > > aligned > > 64 bits are written as one memory transaction, not each 32-bit word > > separately)? > > The

Re: libsanitizer merge from upstream r208536

2014-05-27 Thread Jakub Jelinek
On Tue, May 27, 2014 at 05:04:52PM -0500, Peter Bergner wrote: > On Tue, 2014-05-27 at 23:50 +0200, Jakub Jelinek wrote: > > On Tue, May 27, 2014 at 04:02:08PM -0500, Peter Bergner wrote: > > > It's being called form basically two files: > > > > > > [bergner@makalu-lp1 gcc-fsf-mainline-asan-debug]

Re: libsanitizer merge from upstream r208536

2014-05-27 Thread Peter Bergner
On Tue, 2014-05-27 at 23:50 +0200, Jakub Jelinek wrote: > On Tue, May 27, 2014 at 04:02:08PM -0500, Peter Bergner wrote: > > It's being called form basically two files: > > > > [bergner@makalu-lp1 gcc-fsf-mainline-asan-debug]$ find . -name '*.o' | > > xargs nm -AC | grep sync_fetch_and_add_8 > >

Re: libsanitizer merge from upstream r208536

2014-05-27 Thread Jakub Jelinek
On Tue, May 27, 2014 at 11:50:33PM +0200, Jakub Jelinek wrote: > On Tue, May 27, 2014 at 04:02:08PM -0500, Peter Bergner wrote: > > It's being called form basically two files: > > > > [bergner@makalu-lp1 gcc-fsf-mainline-asan-debug]$ find . -name '*.o' | > > xargs nm -AC | grep sync_fetch_and_add

Re: libsanitizer merge from upstream r208536

2014-05-27 Thread Jakub Jelinek
On Tue, May 27, 2014 at 04:02:08PM -0500, Peter Bergner wrote: > It's being called form basically two files: > > [bergner@makalu-lp1 gcc-fsf-mainline-asan-debug]$ find . -name '*.o' | xargs > nm -AC | grep sync_fetch_and_add_8 > ./powerpc64-linux/32/libsanitizer/sanitizer_common/.libs/sanitizer_a

Re: libsanitizer merge from upstream r208536

2014-05-27 Thread Peter Bergner
On Tue, 2014-05-27 at 20:07 +0200, Jakub Jelinek wrote: > On Mon, May 26, 2014 at 09:25:37PM -0500, Peter Bergner wrote: > > In one of my other posts, I asked should 32-bit ports even attempt > > to use the 2 * word_size atomics. What is the code doing such that > > it wants to use a 2 * word_size

Re: libsanitizer merge from upstream r208536

2014-05-27 Thread Mike Stump
On May 27, 2014, at 11:16 AM, Konstantin Serebryany wrote: > On Tue, May 27, 2014 at 9:53 PM, Mike Stump wrote: >> >> On May 26, 2014, at 10:13 PM, Konstantin Serebryany >> wrote: On Mon, 2014-05-26 at 10:36 +0400, Konstantin Serebryany wrote: > Because this is my default reply to an

Re: libsanitizer merge from upstream r208536

2014-05-27 Thread Konstantin Serebryany
On Tue, May 27, 2014 at 9:53 PM, Mike Stump wrote: > > On May 26, 2014, at 10:13 PM, Konstantin Serebryany > wrote: >>> On Mon, 2014-05-26 at 10:36 +0400, Konstantin Serebryany wrote: Because this is my default reply to any such case. :) >>> >>> I hope that is a humorous reply and not a ser

Re: libsanitizer merge from upstream r208536

2014-05-27 Thread Jakub Jelinek
On Mon, May 26, 2014 at 09:25:37PM -0500, Peter Bergner wrote: > In one of my other posts, I asked should 32-bit ports even attempt > to use the 2 * word_size atomics. What is the code doing such that > it wants to use a 2 * word_size atomic? Is it as simple as commenting > that code out for 32-b

Re: libsanitizer merge from upstream r208536

2014-05-27 Thread Mike Stump
On May 26, 2014, at 10:13 PM, Konstantin Serebryany wrote: >> On Mon, 2014-05-26 at 10:36 +0400, Konstantin Serebryany wrote: >>> Because this is my default reply to any such case. :) >> >> I hope that is a humorous reply and not a serious one. > > Not really humorous. Our position is and alwa

Re: libsanitizer merge from upstream r208536

2014-05-26 Thread Konstantin Serebryany
On Tue, May 27, 2014 at 6:25 AM, Peter Bergner wrote: >> On Mon, May 26, 2014 at 9:57 AM, Jakub Jelinek wrote: >> > Doesn't look like the ppc32 port would be in any worse shape than the >> > 64-bit >> > one. >> > Peter has brought a real problem, in particular the allocator now newly >> > relyi

Re: libsanitizer merge from upstream r208536

2014-05-26 Thread Peter Bergner
> On Mon, May 26, 2014 at 9:57 AM, Jakub Jelinek wrote: > > Doesn't look like the ppc32 port would be in any worse shape than the 64-bit > > one. > > Peter has brought a real problem, in particular the allocator now newly > > relying on > > 2 x word size atomics which is definitely non-portable,

Re: libsanitizer merge from upstream r208536

2014-05-26 Thread Christophe Lyon
On 23 May 2014 17:01, Evgeniy Stepanov wrote: > Hi Christophe, > > is there anything special about your setup? We've seen it build on > arm/linux and arm/android correctly. > > Hi, As Kugan said, I needed to add --enable-obsolete-rpc when configuring glibc. Thanks, Christophe. > On Fri, May 23

Re: libsanitizer merge from upstream r208536

2014-05-26 Thread Yury Gribov
On 05/26/2014 01:19 PM, Konstantin Serebryany wrote: This is implemented in llvm, just need a flag flip. It also needs a performance improvement in the run-time. This is in my TODO, just didn't have time. FYI I have a patch that adds -asan-instrumentation-with-call-threshold for GCC (will send

Re: libsanitizer merge from upstream r208536

2014-05-26 Thread Konstantin Serebryany
Agree. I was going to change instrumentation of unaligned and unusual-sized accesses to simple callbacks. 004b1f30 <_Z3fooP1S>: 4b1f30: 53 push %rbx 4b1f31: 48 89 fbmov%rdi,%rbx 4b1f34: be 04 00 00 00 mov$0x4,%e

Re: libsanitizer merge from upstream r208536

2014-05-26 Thread Jakub Jelinek
On Mon, May 26, 2014 at 11:29:28AM +0400, Konstantin Serebryany wrote: > > Note, I think some work is needed on the library side, > > ERROR: AddressSanitizer: unknown-crash on address 0xffc439cf at pc > > 0x804898e bp 0xffc438d8 sp 0xffc438cc > > > With clang I get this nice report: > > ==20989

Re: libsanitizer merge from upstream r208536

2014-05-26 Thread Konstantin Serebryany
On Fri, May 23, 2014 at 8:45 PM, Jakub Jelinek wrote: > On Fri, May 23, 2014 at 04:11:48PM +0400, Konstantin Serebryany wrote: >> >> 2) it doesn't still deal with unaligned power of two accesses properly, >> >>but neither does llvm (at least not 3.4). Am not talking about >> >>undefined b

Re: libsanitizer merge from upstream r208536

2014-05-25 Thread Konstantin Serebryany
On Mon, May 26, 2014 at 9:57 AM, Jakub Jelinek wrote: > On Mon, May 26, 2014 at 08:57:11AM +0400, Konstantin Serebryany wrote: >> Last time I tried, asan did not work on ppc32 for a large number of >> different reasons. > > ??? > Comparing my 4.9.0 ppc/ppc64 testresults, for 32-bit I see: > > FAIL

Re: libsanitizer merge from upstream r208536

2014-05-25 Thread Jakub Jelinek
On Mon, May 26, 2014 at 08:57:11AM +0400, Konstantin Serebryany wrote: > Last time I tried, asan did not work on ppc32 for a large number of > different reasons. ??? Comparing my 4.9.0 ppc/ppc64 testresults, for 32-bit I see: FAIL: c-c++-common/asan/null-deref-1.c -O0 output pattern test, is A

Re: libsanitizer merge from upstream r208536

2014-05-25 Thread Konstantin Serebryany
Hi Peter, Last time I tried, asan did not work on ppc32 for a large number of different reasons. In upstream build system ppc32 is simply disabled, so imho it should be also disabled in the GCC build. If there is enough interest in ppc32, please work with up on fixing upstream and enabling the bui

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Jakub Jelinek
On Fri, May 23, 2014 at 01:54:47PM -0500, Peter Bergner wrote: > On Fri, 2014-05-23 at 11:47 -0500, Peter Bergner wrote: > > The following patch gets bootstrap working again, but there seems to > > be a large number of testsuite failures I will look into before > > submitting the patch to the LLVM

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Peter Bergner
On Fri, 2014-05-23 at 11:47 -0500, Peter Bergner wrote: > The following patch gets bootstrap working again, but there seems to > be a large number of testsuite failures I will look into before > submitting the patch to the LLVM mailing list. FYI, it looks like a huge number of the failures are fro

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Peter Bergner
On Fri, 2014-05-23 at 09:25 -0500, Peter Bergner wrote: > xagsmtp4.20140523142452.1...@vmsdvm6.vnet.ibm.com > X-Xagent-Gateway: vmsdvm6.vnet.ibm.com (XAGSMTP4 at VMSDVM6) > > On Fri, 2014-05-23 at 17:45 +0400, Konstantin Serebryany wrote: > > On Fri, May 23, 2014 at 5:41 PM, Marek Polacek wrote:

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Jakub Jelinek
On Fri, May 23, 2014 at 04:11:48PM +0400, Konstantin Serebryany wrote: > >> 2) it doesn't still deal with unaligned power of two accesses properly, > >>but neither does llvm (at least not 3.4). Am not talking about > >>undefined behavior cases where the compiler isn't told the access > >>

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Yuri Gribov
On Fri, May 23, 2014 at 11:40 AM, Jakub Jelinek wrote: > No other shared library does anything close to that, for each such library > you can interpose any of its public symbols, either you know what you are > doing when interposing it, or it breaks. I think I have finally recalled why we added t

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Evgeniy Stepanov
Hi Christophe, is there anything special about your setup? We've seen it build on arm/linux and arm/android correctly. On Fri, May 23, 2014 at 6:06 PM, Christophe Lyon wrote: > Hi, > Since merge from upstream r209283 (210743 in GCC), my build fails on > ARM, because rpc/xdr.h is not found. > Is

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Peter Bergner
On Fri, 2014-05-23 at 17:45 +0400, Konstantin Serebryany wrote: > On Fri, May 23, 2014 at 5:41 PM, Marek Polacek wrote: > > On Mon, May 12, 2014 at 03:20:37PM +0400, Konstantin Serebryany wrote: > >> 5 months' worth of changes may break any platform we are not testing > >> ourselves > >> (that in

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Konstantin Serebryany
On Fri, May 23, 2014 at 6:12 PM, Konstantin Serebryany wrote: > On Fri, May 23, 2014 at 6:11 PM, Kugan > wrote: >> On 24/05/14 00:06, Christophe Lyon wrote: >>> Hi, >>> Since merge from upstream r209283 (210743 in GCC), my build fails on >>> ARM, because rpc/xdr.h is not found. >>> Is this expect

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Konstantin Serebryany
On Fri, May 23, 2014 at 6:11 PM, Kugan wrote: > On 24/05/14 00:06, Christophe Lyon wrote: >> Hi, >> Since merge from upstream r209283 (210743 in GCC), my build fails on >> ARM, because rpc/xdr.h is not found. >> Is this expected? > I also have the same issue. I had to build glibc with > --enable-o

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Kugan
On 24/05/14 00:06, Christophe Lyon wrote: > Hi, > Since merge from upstream r209283 (210743 in GCC), my build fails on > ARM, because rpc/xdr.h is not found. > Is this expected? I also have the same issue. I had to build glibc with --enable-obsolete-rpc to bootstrap now. Thanks, Kugan

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Christophe Lyon
Hi, Since merge from upstream r209283 (210743 in GCC), my build fails on ARM, because rpc/xdr.h is not found. Is this expected? Thanks, Christophe. On 23 May 2014 15:45, Konstantin Serebryany wrote: > On Fri, May 23, 2014 at 5:41 PM, Marek Polacek wrote: >> On Mon, May 12, 2014 at 03:20:37PM

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Konstantin Serebryany
On Fri, May 23, 2014 at 5:41 PM, Marek Polacek wrote: > On Mon, May 12, 2014 at 03:20:37PM +0400, Konstantin Serebryany wrote: >> 5 months' worth of changes may break any platform we are not testing >> ourselves >> (that includes Ubuntu 12.04, 13.10, 14.04, Mac 10.9, Windows 7, Android ARM), >> p

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Marek Polacek
On Mon, May 12, 2014 at 03:20:37PM +0400, Konstantin Serebryany wrote: > 5 months' worth of changes may break any platform we are not testing ourselves > (that includes Ubuntu 12.04, 13.10, 14.04, Mac 10.9, Windows 7, Android ARM), > please help us test this patch on your favorite platform. On pow

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Konstantin Serebryany
>> 2) it doesn't still deal with unaligned power of two accesses properly, >>but neither does llvm (at least not 3.4). Am not talking about >>undefined behavior cases where the compiler isn't told the access >>is misaligned, but e.g. when accessing struct S { int x; } >>__attribute

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Paolo Carlini
Hi, On 05/23/2014 12:26 PM, Yury Gribov wrote: >> Could you add something like > > It's always linux-vdso.so.1, but wasn't that already known, given the > ldd requested by Jakub?!? Well, for me dlpi_name for vdso was empty string hence I kept asking. I also thought that ldd and dl_iterate_phdr

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Yury Gribov
>> Could you add something like > > It's always linux-vdso.so.1, but wasn't that already known, given the > ldd requested by Jakub?!? Well, for me dlpi_name for vdso was empty string hence I kept asking. I also thought that ldd and dl_iterate_phdr might have used slightly different code paths w

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Jakub Jelinek
On Fri, May 23, 2014 at 11:25:02AM +0200, Paolo Carlini wrote: > >>How do I print dlpi_name? > > > >Could you add something like > > Report("'%s'\n", info->dlpi_name); > >after > > if (!info->dlpi_name || info->dlpi_name[0] == 0) > >check in FindFirstDSOCallback? This should give us the name of >

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Paolo Carlini
Hi, On 05/23/2014 11:21 AM, Yury Gribov wrote: I've checked all available systems and wasn't able to repro this. Given your exchanges with Jakub I thought that at this point it was clear that the issue is real. There are three issues here: 1) whether warning should cause termination 2) wheth

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Yury Gribov
> still should have come up on your machine in the first place. should not have

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Yury Gribov
I've checked all available systems and wasn't able to repro this. Given your exchanges with Jakub I thought that at this point it was clear that the issue is real. There are three issues here: 1) whether warning should cause termination 2) whether warning should be displayed by default 3) why

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Paolo Carlini
Hi, On 05/23/2014 10:50 AM, Yury Gribov wrote: Paolo, I've checked all available systems and wasn't able to repro this. Given your exchanges with Jakub I thought that at this point it was clear that the issue is real. Every time vDSO was already filtered with if (!info->dlpi_name || info->

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Yury Gribov
Paolo, I've checked all available systems and wasn't able to repro this. Every time vDSO was already filtered with if (!info->dlpi_name || info->dlpi_name[0] == 0) return 0; in FindFirstDSOCallback. Could you provide additional details of your setup? Or perhaps print dlpi_name of offend

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Paolo Carlini
Hi, On 05/23/2014 09:47 AM, Jakub Jelinek wrote: On Fri, May 23, 2014 at 11:34:38AM +0400, Konstantin Serebryany wrote: Failing to intercept something may cause not just false negatives, but also false positives. These cases are often exceptionally hard to debug, so any checking that the interc

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Konstantin Serebryany
On Fri, May 23, 2014 at 11:56 AM, Ramana Radhakrishnan wrote: > On 05/23/14 08:50, Yury Gribov wrote: >> >> > On ARM the asan tests have always been a random generator of PASS / >> > FAIL on qemu despite efforts to "nobble" qemu for /proc/self/maps >> > outputs. >> >> This should improve onc

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Ramana Radhakrishnan
On 05/23/14 08:50, Yury Gribov wrote: > On ARM the asan tests have always been a random generator of PASS / > FAIL on qemu despite efforts to "nobble" qemu for /proc/self/maps > outputs. This should improve once upstream Asan sets up an ARM build bot. This has been discussed recently but n

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Yury Gribov
> On ARM the asan tests have always been a random generator of PASS / > FAIL on qemu despite efforts to "nobble" qemu for /proc/self/maps > outputs. This should improve once upstream Asan sets up an ARM build bot. This has been discussed recently but noone has yet volunteered to do the server i

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Jakub Jelinek
On Fri, May 23, 2014 at 11:34:38AM +0400, Konstantin Serebryany wrote: > Failing to intercept something may cause not just false negatives, but > also false positives. > These cases are often exceptionally hard to debug, so any checking that > the interception machinery works as intended is good. O

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Konstantin Serebryany
On Fri, May 23, 2014 at 11:32 AM, Ramana Radhakrishnan wrote: > On Thu, May 22, 2014 at 7:31 AM, Konstantin Serebryany > wrote: >> On Wed, May 21, 2014 at 11:43 PM, Jakub Jelinek wrote: >>> On Wed, May 21, 2014 at 04:09:19PM +0400, Konstantin Serebryany wrote: A new patch based on r209283.

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Jakub Jelinek
On Fri, May 23, 2014 at 11:20:01AM +0400, Yury Gribov wrote: > >Even before this exaggerated check asan imposes far more restrictions than > >good, and this just makes asan less usable just for fear that it wouldn't > >work right. > > Ok, we seem to approach this from two different angles. > I usu

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Konstantin Serebryany
On Fri, May 23, 2014 at 11:20 AM, Yury Gribov wrote: > On 05/23/2014 10:34 AM, Jakub Jelinek wrote: Otherwise libasan apps will simply stop working altogether if LD_PRELOAD is set, to whatever library, even if it doesn't define any symbols you care about. >>> >>> >>> Right but

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Ramana Radhakrishnan
On Thu, May 22, 2014 at 7:31 AM, Konstantin Serebryany wrote: > On Wed, May 21, 2014 at 11:43 PM, Jakub Jelinek wrote: >> On Wed, May 21, 2014 at 04:09:19PM +0400, Konstantin Serebryany wrote: >>> A new patch based on r209283. >>> This one has the H.J.'s patches for x32. >> >> Ok for trunk then.

Re: libsanitizer merge from upstream r208536

2014-05-23 Thread Yury Gribov
On 05/23/2014 10:34 AM, Jakub Jelinek wrote: Otherwise libasan apps will simply stop working altogether if LD_PRELOAD is set, to whatever library, even if it doesn't define any symbols you care about. Right but I'm not sure whether failing fast here is necessarily bad. I think it is very bad.

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Jakub Jelinek
On Fri, May 23, 2014 at 09:30:12AM +0400, Yury Gribov wrote: > > much better would be just dlsym a couple of > > interesting symbols to verify that libasan.so.1 is ahead > > of libc.so.6, libstdc++.so.6, libpthread.so.0 (whatever else > > you want to override). > > One problem with dlsym() that I'

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Yury Gribov
On 05/22/2014 11:54 PM, Jakub Jelinek wrote: > Kostya, guess you should ignore the vDSO. Right, we didn't encounter this problem when testing on our kernels. I'll cook a patch for this. > much better would be just dlsym a couple of > interesting symbols to verify that libasan.so.1 is ahead > o

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Konstantin Serebryany
Yuri, this comes from yours http://llvm.org/viewvc/llvm-project?view=revision&revision=205308 Could you please take a look? On Thu, May 22, 2014 at 11:54 PM, Jakub Jelinek wrote: > On Thu, May 22, 2014 at 09:43:01PM +0200, Paolo Carlini wrote: >> Hi, >> >> On 05/22/2014 09:15 PM, Jakub Jelinek wr

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Jakub Jelinek
On Thu, May 22, 2014 at 09:43:01PM +0200, Paolo Carlini wrote: > Hi, > > On 05/22/2014 09:15 PM, Jakub Jelinek wrote: > >Do you have LD_PRELOAD set in the environment? > I don't. > >If not, can you cut'n'paste the large-func-test-1.exe command line > >and run it with the given LD_LIBRARY_PATH unde

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Paolo Carlini
Hi, On 05/22/2014 09:15 PM, Jakub Jelinek wrote: Do you have LD_PRELOAD set in the environment? I don't. If not, can you cut'n'paste the large-func-test-1.exe command line and run it with the given LD_LIBRARY_PATH under ldd? Jakub Sure. This is what I get: linux-vdso.so.1 (0x7ff

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Jakub Jelinek
On Thu, May 22, 2014 at 09:03:44PM +0200, Paolo Carlini wrote: > Hi, > > On 05/22/2014 09:02 PM, Jakub Jelinek wrote: > >On Thu, May 22, 2014 at 08:38:31PM +0200, Paolo Carlini wrote: > >>Hi, > >> > >>On 05/22/2014 01:03 PM, Jakub Jelinek wrote: > >>>On Thu, May 22, 2014 at 02:26:19PM +0400, Konst

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Paolo Carlini
Hi, On 05/22/2014 09:02 PM, Jakub Jelinek wrote: On Thu, May 22, 2014 at 08:38:31PM +0200, Paolo Carlini wrote: Hi, On 05/22/2014 01:03 PM, Jakub Jelinek wrote: On Thu, May 22, 2014 at 02:26:19PM +0400, Konstantin Serebryany wrote: FAIL: c-c++-common/asan/asan-interface-1.c -O0 execution t

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Jakub Jelinek
On Thu, May 22, 2014 at 08:38:31PM +0200, Paolo Carlini wrote: > Hi, > > On 05/22/2014 01:03 PM, Jakub Jelinek wrote: > >On Thu, May 22, 2014 at 02:26:19PM +0400, Konstantin Serebryany wrote: > >>FAIL: c-c++-common/asan/asan-interface-1.c -O0 execution test > >Is that before or after r21

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Paolo Carlini
Hi, On 05/22/2014 01:03 PM, Jakub Jelinek wrote: On Thu, May 22, 2014 at 02:26:19PM +0400, Konstantin Serebryany wrote: FAIL: c-c++-common/asan/asan-interface-1.c -O0 execution test Is that before or after r210743? Can't reproduce the above (note, not bootstrapped compiler, just --disable-b

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Jakub Jelinek
On Thu, May 22, 2014 at 04:07:38PM +0200, Jakub Jelinek wrote: > 2014-05-22 Jakub Jelinek > > * sanitizer.def (BUILT_IN_ASAN_REPORT_LOAD_N, > BUILT_IN_ASAN_REPORT_STORE_N): New. > * asan.c (struct asan_mem_ref): Change access_size type to > HOST_WIDE_INT. > (asan_m

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Konstantin Serebryany
> >> > 3) there is still a failure for -m32: >> > FAIL: g++.dg/asan/asan_test.C -O2 AddressSanitizer_UAF_long_double >> > Ident(p)[12] = 0 output pattern test >> > Output should match: WRITE of size 1[06] >> > FAIL: g++.dg/asan/asan_test.C -O2 AddressSanitizer_UAF_long_double >> > Ident(p)[0]

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Jakub Jelinek
On Thu, May 22, 2014 at 06:34:22PM +0400, Konstantin Serebryany wrote: > > Notes: > > 1) the cases where we e.g. for various stringops perform first and > >last address check and use separate __asan_report_*1 for reporting > >that should probably be converted to use this __asan_report_*_n t

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Konstantin Serebryany
On Thu, May 22, 2014 at 6:07 PM, Jakub Jelinek wrote: > On Thu, May 22, 2014 at 04:06:21PM +0400, Konstantin Serebryany wrote: >> Not really recently... (Feb 2013) >> http://llvm.org/viewvc/llvm-project?rev=175507&view=rev > > Ah, wasn't aware of that. > > Here is (so far not bootstrapped/regteste

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Jakub Jelinek
On Thu, May 22, 2014 at 04:06:21PM +0400, Konstantin Serebryany wrote: > Not really recently... (Feb 2013) > http://llvm.org/viewvc/llvm-project?rev=175507&view=rev Ah, wasn't aware of that. Here is (so far not bootstrapped/regtested) patch for the GCC side. Notes: 1) the cases where we e.g. for

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Konstantin Serebryany
Oops, ignore that. Forgot -C gcc On Thu, May 22, 2014 at 4:49 PM, Konstantin Serebryany wrote: > On Thu, May 22, 2014 at 3:03 PM, Jakub Jelinek wrote: >> On Thu, May 22, 2014 at 02:26:19PM +0400, Konstantin Serebryany wrote: >>> >> >> FAIL: c-c++-common/asan/asan-interface-1.c -O0 execution te

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Konstantin Serebryany
On Thu, May 22, 2014 at 3:03 PM, Jakub Jelinek wrote: > On Thu, May 22, 2014 at 02:26:19PM +0400, Konstantin Serebryany wrote: >> >> >> FAIL: c-c++-common/asan/asan-interface-1.c -O0 execution test >> >> >Is that before or after r210743? > > Can't reproduce the above (note, not bootstrapped comp

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Konstantin Serebryany
On Thu, May 22, 2014 at 3:43 PM, Jakub Jelinek wrote: > On Thu, May 22, 2014 at 01:03:48PM +0200, Jakub Jelinek wrote: >> There are various other changes to asan_test.cc, so guess some work is >> needed on that. > > Ok, tried to merge also g++.dg/asan from the same revision as you've merged > lib

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Jakub Jelinek
On Thu, May 22, 2014 at 01:03:48PM +0200, Jakub Jelinek wrote: > There are various other changes to asan_test.cc, so guess some work is needed > on that. Ok, tried to merge also g++.dg/asan from the same revision as you've merged libsanitizer. On x86_64-linux, both -m32 and -m64 I see FAIL: g++

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Jakub Jelinek
On Thu, May 22, 2014 at 02:26:19PM +0400, Konstantin Serebryany wrote: > >> >> FAIL: c-c++-common/asan/asan-interface-1.c -O0 execution test > >> >Is that before or after r210743? Can't reproduce the above (note, not bootstrapped compiler, just --disable-bootstrap), check-gcc RUNTESTFLAGS=asan.e

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Paolo Carlini
Hi On 22 maggio 2014 12:26:19 CEST, Konstantin Serebryany wrote: >What is the exact command are you running? Sorry, now I'm traveling. But nothing special, a very simple c and c++ build on x86_64-linux. No special flags, all defaults. If nobody can reproduce I'll try to fetch again the tree

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Konstantin Serebryany
What is the exact command are you running? On Thu, May 22, 2014 at 1:47 PM, Jakub Jelinek wrote: > On Thu, May 22, 2014 at 11:44:06AM +0200, Paolo Carlini wrote: >> On 22 maggio 2014 11:05:31 CEST, Konstantin Serebryany >> wrote: >> >On Thu, May 22, 2014 at 12:54 PM, Paolo Carlini >> > wrote: >

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Jakub Jelinek
On Thu, May 22, 2014 at 11:44:06AM +0200, Paolo Carlini wrote: > On 22 maggio 2014 11:05:31 CEST, Konstantin Serebryany > wrote: > >On Thu, May 22, 2014 at 12:54 PM, Paolo Carlini > > wrote: > >> .. sorry, I didn't follow the whole thread, but today I'm seeing > >loads of > >> failures when testi

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Paolo Carlini
Hi, On 22 maggio 2014 11:05:31 CEST, Konstantin Serebryany wrote: >On Thu, May 22, 2014 at 12:54 PM, Paolo Carlini > wrote: >> .. sorry, I didn't follow the whole thread, but today I'm seeing >loads of >> failures when testing C++ on x86_64-linux, beginning with: >> >> FAIL: c-c++-common/asan/

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Konstantin Serebryany
On Thu, May 22, 2014 at 12:54 PM, Paolo Carlini wrote: > .. sorry, I didn't follow the whole thread, but today I'm seeing loads of > failures when testing C++ on x86_64-linux, beginning with: > > FAIL: c-c++-common/asan/asan-interface-1.c -O0 execution test Is that before or after r210743? > FAI

Re: libsanitizer merge from upstream r208536

2014-05-22 Thread Paolo Carlini
.. sorry, I didn't follow the whole thread, but today I'm seeing loads of failures when testing C++ on x86_64-linux, beginning with: FAIL: c-c++-common/asan/asan-interface-1.c -O0 execution test FAIL: c-c++-common/asan/asan-interface-1.c -O1 execution test FAIL: c-c++-common/asan/asan-interf

Re: libsanitizer merge from upstream r208536

2014-05-21 Thread Konstantin Serebryany
On Wed, May 21, 2014 at 11:43 PM, Jakub Jelinek wrote: > On Wed, May 21, 2014 at 04:09:19PM +0400, Konstantin Serebryany wrote: >> A new patch based on r209283. >> This one has the H.J.'s patches for x32. > > Ok for trunk then. But please help the ppc*/arm*/sparc* maintainers if > issues on > th

Re: libsanitizer merge from upstream r208536

2014-05-21 Thread Jakub Jelinek
On Wed, May 21, 2014 at 04:09:19PM +0400, Konstantin Serebryany wrote: > A new patch based on r209283. > This one has the H.J.'s patches for x32. Ok for trunk then. But please help the ppc*/arm*/sparc* maintainers if issues on those targets are reported. Thanks. Jakub

Re: libsanitizer merge from upstream r208536

2014-05-21 Thread H.J. Lu
On Wed, May 21, 2014 at 5:09 AM, Konstantin Serebryany wrote: > A new patch based on r209283. > This one has the H.J.'s patches for x32. > This one is good on x32. Thanks. -- H.J.

Re: libsanitizer merge from upstream r208536

2014-05-15 Thread Jakub Jelinek
On Thu, May 15, 2014 at 12:20:06PM +0400, Yury Gribov wrote: > On 05/15/2014 12:05 PM, Konstantin Serebryany wrote: > >No. We have to support too many build systems and hence do not want > >any configure step. > >All configuration has to be done in the sources. > > Yeah, I see your point. But fill

Re: libsanitizer merge from upstream r208536

2014-05-15 Thread Konstantin Serebryany
On Thu, May 15, 2014 at 12:07 PM, Andrew Pinski wrote: > On Thu, May 15, 2014 at 1:05 AM, Konstantin Serebryany > wrote: >> H.J., >> Thanks for the patches. Please (re)send them to llvm-commits, >> otherwise I can not accept them. > > > I think this is bogus reasoning. You should be able to take

Re: libsanitizer merge from upstream r208536

2014-05-15 Thread Konstantin Serebryany
> > I think this argument is bogus. Please do one build system and > support it. Simple makefile and some scripts seems simple to support > so you don't need anything extra. Would be glad to. One (but not the only) prerequisite for that GCC exports libsanitizer as "svn external" and uses our cm

Re: libsanitizer merge from upstream r208536

2014-05-15 Thread Yury Gribov
On 05/15/2014 12:05 PM, Konstantin Serebryany wrote: No. We have to support too many build systems and hence do not want any configure step. All configuration has to be done in the sources. Yeah, I see your point. But filling code with magic constants isn't very nice either. We could make a

Re: libsanitizer merge from upstream r208536

2014-05-15 Thread Andrew Pinski
On Thu, May 15, 2014 at 1:05 AM, Konstantin Serebryany wrote: > H.J., > Thanks for the patches. Please (re)send them to llvm-commits, > otherwise I can not accept them. I think this is bogus reasoning. You should be able to take and post them yourself. Those patches. Thanks, Andrew Pinski >

Re: libsanitizer merge from upstream r208536

2014-05-15 Thread Konstantin Serebryany
H.J., Thanks for the patches. Please (re)send them to llvm-commits, otherwise I can not accept them. --kcc On Wed, May 14, 2014 at 2:31 AM, H.J. Lu wrote: > On Tue, May 13, 2014 at 2:02 AM, Konstantin Serebryany > wrote: >> New patch attached. >> It is based on r208674 which enables LeakSanitiz

Re: libsanitizer merge from upstream r208536

2014-05-15 Thread Andrew Pinski
On Thu, May 15, 2014 at 1:05 AM, Konstantin Serebryany wrote: > On Thu, May 15, 2014 at 9:28 AM, Yury Gribov wrote: >> On 05/14/2014 08:51 AM, Konstantin Serebryany wrote: One theme I have been noticing in the libsanitizer code is that it has all of the knowledge of glibc when it c

Re: libsanitizer merge from upstream r208536

2014-05-15 Thread Konstantin Serebryany
On Thu, May 15, 2014 at 9:28 AM, Yury Gribov wrote: > On 05/14/2014 08:51 AM, Konstantin Serebryany wrote: >>> >>> One theme I have been noticing in the libsanitizer code is that it has >>> all of the knowledge of glibc when it comes to syscalls but makes some >>> bad assumptions dealing with some

  1   2   >