Memory leak in gcc version 2.95.4 20010319 (Debian prerelease) STL
Hello,
We have found a memory leak bug in gcc version 2.95.4 20010319 (Debian prerelease) under debian woody on intel.
The bug happens with the following code :
#include <vector>
#include <mcheck.h>
int main(int argc, char *argv[])
{
vector<int> toto;
// enable leak tracing
mtrace ();
// the push_back methode leaks !!!
for (int i=0;i<3000;i++)
{
toto.push_back(0);
}
// if muntrace is skipped, there is one leak less, because of the delete of the vector
//muntrace();
}
This seems like the STL vector doesn't free its memory on resize.
We haven't found any place to correctly report this on gcc site, as everyone is already on version 3.
We have looked into the STL code, but it's quite unreadable.
Our linux kernel version is :
Linux version 2.2.18-smp (root@fritz) (gcc version 2.95.2 20000220 (Debian GNU/Linux)) #1 SMP Thu Feb 22 09:29:08 EST 2001
And we are on Debian Woody 2.3
Thanks a lot
Stephane Magnenat
Luc Olivier de Charriere
Reply to: