This is the mail archive of the libstdc++@sources.redhat.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcc 2.96, libstdc++ v3 and efence


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]