Re: [PATCH] Add AddressSanitizer annotations to std::vector

2017-07-21 Thread Jonathan Wakely
On 05/07/17 21:24 +0100, Jonathan Wakely wrote: On 05/07/17 20:44 +0100, Yuri Gribov wrote: On Wed, Jul 5, 2017 at 8:00 PM, Jonathan Wakely wrote: This patch adds AddressSanitizer annotations to std::vector, so that ASan can detect out-of-bounds accesses to the unused capacity of a vector. e.g

Re: [PATCH] Add AddressSanitizer annotations to std::vector

2017-07-10 Thread Jonathan Wakely
On 06/07/17 20:23 +0300, Ivan Baravy wrote: On 07/05/2017 10:00 PM, Jonathan Wakely wrote: This patch adds AddressSanitizer annotations to std::vector, so that ASan can detect out-of-bounds accesses to the unused capacity of a vector. e.g. std::vector v(2); int* p = v.data(); v.pop_back()

Re: [PATCH] Add AddressSanitizer annotations to std::vector

2017-07-06 Thread Ivan Baravy
On 07/05/2017 10:00 PM, Jonathan Wakely wrote: > This patch adds AddressSanitizer annotations to std::vector, so that > ASan can detect out-of-bounds accesses to the unused capacity of a > vector. e.g. > > std::vector v(2); > int* p = v.data(); > v.pop_back(); > return p[1]; // ERROR > >

Re: [PATCH] Add AddressSanitizer annotations to std::vector

2017-07-05 Thread Jonathan Wakely
On 05/07/17 20:44 +0100, Yuri Gribov wrote: On Wed, Jul 5, 2017 at 8:00 PM, Jonathan Wakely wrote: This patch adds AddressSanitizer annotations to std::vector, so that ASan can detect out-of-bounds accesses to the unused capacity of a vector. e.g. std::vector v(2); int* p = v.data(); v.pop_

Re: [PATCH] Add AddressSanitizer annotations to std::vector

2017-07-05 Thread Yuri Gribov
On Wed, Jul 5, 2017 at 8:00 PM, Jonathan Wakely wrote: > This patch adds AddressSanitizer annotations to std::vector, so that > ASan can detect out-of-bounds accesses to the unused capacity of a > vector. e.g. > > std::vector v(2); > int* p = v.data(); > v.pop_back(); > return p[1]; // ERROR

Re: [PATCH] Add AddressSanitizer annotations to std::vector

2017-07-05 Thread Jonathan Wakely
On 05/07/17 20:00 +0100, Jonathan Wakely wrote: We can probably do similar annotations for std::deque, so that partially filled pages are annotated. I also have a patch for shared_ptr so that objects created by make_shared can be marked as invalid after they're destroyed. This is the make_share

[PATCH] Add AddressSanitizer annotations to std::vector

2017-07-05 Thread Jonathan Wakely
This patch adds AddressSanitizer annotations to std::vector, so that ASan can detect out-of-bounds accesses to the unused capacity of a vector. e.g. std::vector v(2); int* p = v.data(); v.pop_back(); return p[1]; // ERROR This cannot be detected by Debug Mode, but with these annotations ASa