Re: detecting "container overflow" bugs in std::vector

2014-06-03 Thread Konstantin Serebryany
On Thu, May 29, 2014 at 6:29 PM, Jonathan Wakely wrote: > On 26/05/14 19:19 +0400, Konstantin Serebryany wrote: >>> >>> It does look useful but I'm concerned about a proliferation of >>> container checks, we already have the libstdc++ Debug Mode >>> and I'd >>> like to see some of the lightweight

Re: detecting "container overflow" bugs in std::vector

2014-05-29 Thread Jonathan Wakely
On 26/05/14 19:19 +0400, Konstantin Serebryany wrote: It does look useful but I'm concerned about a proliferation of container checks, we already have the libstdc++ Debug Mode and I'd like to see some of the lightweight checks from the Google branch added to trunk too. Me too, but these checks a

Re: detecting "container overflow" bugs in std::vector

2014-05-26 Thread Paul Pluzhnikov
On Mon, May 26, 2014 at 8:19 AM, Konstantin Serebryany wrote: > > On Mon, May 26, 2014 at 6:12 PM, Jonathan Wakely wrote: > > I see that the patch on the Google branch removes some of the > > __google_stl_debug_vector checks -- are they considered no longer > > necessary/useful with asan? > > Th

Re: detecting "container overflow" bugs in std::vector

2014-05-26 Thread Konstantin Serebryany
On Mon, May 26, 2014 at 6:12 PM, Jonathan Wakely wrote: > On 26/05/14 17:40 +0400, Konstantin Serebryany wrote: >> >> Would you consider a patch similar to [4] for libstdc++ trunk? >> If yes, any comments on the patch? > > > + // When sanitizer annotataions are off, avoid bazillion of no-op >

Re: detecting "container overflow" bugs in std::vector

2014-05-26 Thread Jonathan Wakely
On 26/05/14 15:12 +0100, Jonathan Wakely wrote: It does look useful but I'm concerned about a proliferation of container checks, we already have the libstdc++ Debug Mode, and I'd like to see some of the lightweight checks from the Google branch added to trunk too. I see that the patch on the Go

Re: detecting "container overflow" bugs in std::vector

2014-05-26 Thread Jonathan Wakely
On 26/05/14 17:40 +0400, Konstantin Serebryany wrote: Would you consider a patch similar to [4] for libstdc++ trunk? If yes, any comments on the patch? + // When sanitizer annotataions are off, avoid bazillion of no-op I'd rather see the member functions use our

detecting "container overflow" bugs in std::vector

2014-05-26 Thread Konstantin Serebryany
Hello, Some of std::vector misuses are very hard to find with internal STL checks or using external tools (such as Valgrind or AddressSanitizer [1]). Example: std::vector v(4); v.reserve(8); int *p = v.data(); p[6] = 0; // BOOM We call these bugs "container overflow" [2,6] and we've deve