This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [google gcc-4_7, integration] Scribble on destructed strings to catch invalid accesses.
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Chris Jefferson <chris at bubblescope dot net>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Fri, 25 Jan 2013 11:14:28 +0100 (CET)
- Subject: Re: [google gcc-4_7, integration] Scribble on destructed strings to catch invalid accesses.
- References: <ye6qy5fjcd5y.fsf@elbrus2.mtv.corp.google.com> <alpine.DEB.2.02.1301241952370.3737@laptop-mg.saclay.inria.fr> <51018E3F.9050308@bubblescope.net>
- Reply-to: libstdc++ at gcc dot gnu dot org
On Thu, 24 Jan 2013, Chris Jefferson wrote:
On 24/01/13 19:03, Marc Glisse wrote:
On Wed, 23 Jan 2013, Paul Pluzhnikov wrote:
This patch allows us to catch use of destructed strings.
Hello,
while a number of the google debug patches are just cheaper versions (that
don't break the ABI) of what libstdc++'s debug mode provides, this
overwriting of classes on destruction is not as obviously redundant, and I
wonder whether something like it (done consistently for many classes) could
go to trunk...
A possibly crazy suggestion.. How hard would it be to add this automatically
to all calls to destructors? (via a command line flag obviously)
Now that you say it, I think I've heard it suggested before :-) Or maybe
it was overwriting pointers after a call to delete.
It doesn't sound very hard (I could of course be wrong). One issue is that
when the destructor is manually called (for an object created with
placement new), it could break code, and although such code would be
dubious, I am not 100% sure if it is necessarily illegal (probably is). I
am not sure how it would interact with optimizations either, if gcc would
remove just the ones it can prove are useless, or all of them.
--
Marc Glisse