Re: [patch][google/integration] Add lightweight checks to vector::begin et. al. (issue4973065)

2011-09-07 Thread Pedro Alves
On Tuesday 06 September 2011 23:09:17, Jonathan Wakely wrote: On 6 September 2011 22:58, Paul Pluzhnikov wrote: On Tue, Sep 6, 2011 at 2:51 PM, Jonathan Wakely jwakely@gmail.com wrote: I don't mean for vector::begin and the other functions in that patch, I mean in general for

[patch][google/integration] Add lightweight checks to vector::begin et. al. (issue4973065)

2011-09-06 Thread Paul Pluzhnikov
Greetings, This patch adds a lightweight self-consistency check to many vector operations. Google issue 5246356. Ok for google/integration branch? Thanks, -- 2011-09-06 Paul Pluzhnikov ppluzhni...@google.com * include/bits/stl_vector.h (__is_valid): New function. (begin,

Re: [patch][google/integration] Add lightweight checks to vector::begin et. al. (issue4973065)

2011-09-06 Thread Paul Pluzhnikov
On Tue, Sep 6, 2011 at 9:28 AM, Paul Pluzhnikov ppluzhni...@google.com wrote: This patch adds a lightweight self-consistency check to many vector operations. Google issue 5246356. Sorry, forgot to mention: tested by doing bootstrap and make check on Linux/x86_64. -- Paul Pluzhnikov

Re: [patch][google/integration] Add lightweight checks to vector::begin et. al. (issue4973065)

2011-09-06 Thread Diego Novillo
On Tue, Sep 6, 2011 at 12:28, Paul Pluzhnikov ppluzhni...@google.com wrote: Greetings, This patch adds a lightweight self-consistency check to many vector operations. Google issue 5246356. Ok for google/integration branch? Thanks, -- 2011-09-06  Paul Pluzhnikov  ppluzhni...@google.com

Re: [patch][google/integration] Add lightweight checks to vector::begin et. al. (issue4973065)

2011-09-06 Thread Diego Novillo
On Tue, Sep 6, 2011 at 12:54, Paul Pluzhnikov ppluzhni...@google.com wrote: On Tue, Sep 6, 2011 at 9:44 AM, Diego Novillo dnovi...@google.com wrote: OK.  Any reason not to send this (or a variant) to mainline? AFAIU, mainline is not interested -- there is already a debug mode (enabled by

Re: [patch][google/integration] Add lightweight checks to vector::begin et. al. (issue4973065)

2011-09-06 Thread Paul Pluzhnikov
On Tue, Sep 6, 2011 at 10:46 AM, Diego Novillo dnovi...@google.com wrote: On Tue, Sep 6, 2011 at 12:54, Paul Pluzhnikov ppluzhni...@google.com wrote: On Tue, Sep 6, 2011 at 9:44 AM, Diego Novillo dnovi...@google.com wrote: OK.  Any reason not to send this (or a variant) to mainline? AFAIU,

Re: [patch][google/integration] Add lightweight checks to vector::begin et. al. (issue4973065)

2011-09-06 Thread Jonathan Wakely
On 6 September 2011 19:01, Paul Pluzhnikov wrote: But this is something to discuss with libstdc++ (CC'd). Sure. If the parallel debug mode is more tenable now, I am all for it. I don't think anything has changed. I'm not excited by the idea of another debug mode, especially not this patch,

Re: [patch][google/integration] Add lightweight checks to vector::begin et. al. (issue4973065)

2011-09-06 Thread Jonathan Wakely
On 6 September 2011 20:23, Jonathan Wakely wrote: What's a dangling vector anyway?  One that has been moved from? Apparently not, since a moved-from vector would pass __valid() (as indeed it should) So I'm quite curious what bugs this catches. The existing debug mode catches some fairly

Re: [patch][google/integration] Add lightweight checks to vector::begin et. al. (issue4973065)

2011-09-06 Thread Paul Pluzhnikov
On Tue, Sep 6, 2011 at 12:44 PM, Jonathan Wakely jwakely@gmail.com wrote: On 6 September 2011 20:23, Jonathan Wakely wrote: What's a dangling vector anyway?  One that has been moved from? Apparently not, since a moved-from vector would pass __valid() (as indeed it should) So I'm quite

Re: [patch][google/integration] Add lightweight checks to vector::begin et. al. (issue4973065)

2011-09-06 Thread Christopher Jefferson
On 6 Sep 2011, at 21:19, Paul Pluzhnikov wrote: On Tue, Sep 6, 2011 at 12:44 PM, Jonathan Wakely jwakely@gmail.com wrote: On 6 September 2011 20:23, Jonathan Wakely wrote: What's a dangling vector anyway? One that has been moved from? Apparently not, since a moved-from vector

Re: [patch][google/integration] Add lightweight checks to vector::begin et. al. (issue4973065)

2011-09-06 Thread Paul Pluzhnikov
On Tue, Sep 6, 2011 at 1:33 PM, Jonathan Wakely jwakely@gmail.com wrote:  for (it = v-begin(); it != v-end(); ++it)  // Oops! Eurgh, the occurrence of delete in anything except a destructor is a code smell that should have led someone to find those bugs anyway! Obviously the code above

Re: [patch][google/integration] Add lightweight checks to vector::begin et. al. (issue4973065)

2011-09-06 Thread Jonathan Wakely
On 6 September 2011 21:52, Paul Pluzhnikov wrote: On Tue, Sep 6, 2011 at 1:33 PM, Jonathan Wakely jwakely@gmail.com wrote:  for (it = v-begin(); it != v-end(); ++it)  // Oops! Eurgh, the occurrence of delete in anything except a destructor is a code smell that should have led someone to

Re: [patch][google/integration] Add lightweight checks to vector::begin et. al. (issue4973065)

2011-09-06 Thread Paul Pluzhnikov
On Tue, Sep 6, 2011 at 2:51 PM, Jonathan Wakely jwakely@gmail.com wrote: I don't mean for vector::begin and the other functions in that patch, I mean in general for member functions of any type. There are plenty of functions that wouldn't crash when called through a null pointer. But even