gcc 2.96, libstdc++ v3 and efence

Alexandre Oliva aoliva@redhat.com
Tue Aug 22 01:50:00 GMT 2000


On Aug 22, 2000, umbpux@tin.it wrote:

>> On Aug 21, 2000, Maurizio Umberto Puxeddu <umbpux@tin.it> wrote:
>> 
>> >   int *p = new int;
>> >   delete [] p;
>> 
>> This is wrong.  If you allocate with `new', deallocate with `delete',
>> not `delete[]'.

> that was obviously just a typo.

Not that obviously.  You were reporting a crash, and messing up malloc
data structures is a common source of crashes :-)

> but the problem is there, have you seen the back trace?

Yep.  I think the problem has to do with the fact that some dynamic
initializers of libstdc++ are using new and delete, but you have
defined them so as to depend on cout having already been initialized,
but it depends on some the stuff that's using new and delete.  I.e.,
I'm not sure your example is valid C++.  It would be nice if we could
run it, though.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me



More information about the Libstdc++ mailing list