- To: bug-gcc at gnu dot org
- Subject: memory leak in egcs-1.1.2
- From: gustavo <gustavo at geneura dot ugr dot es>
- Date: Thu, 02 Sep 1999 19:57:13 +0200
Hi:
After an upgrade from RedHat 5.2 to 6.0 a problem apear with a
program.
We compiling this program the process cc1plus starts "eating"
all
the
memory.
The system is a Dell PowerEdge 1300 (2 x Pentium III with
512MB)
with
Redhat 6.0 default server instalation and all egcs packages
(egcs-1.1.2-12...).
Command line: g++ bug.cc
The result: sometimes the system is hanged, sometimes the
compiling
process stop with a error message:
bug.cc:118: virtual memory exhausted
After this error, I went back to a Redhat 5.2 system and every
was ok.
The problem isn't the machine, we have test it on several
(Pentium II,
amd k6, pentium III) Redhat 5.2 systems (with egcs-1.0.3). In
the
same
machines with Redhat 6.0 the error apear always.
Thanks
Gustavo
//-----------------------------------------------------------------
// bug.cc
//-----------------------------------------------------------------
#include <pair.h> // pair
//-----------------------------------------------------------------
template<class Chrom> class Select
{
public:
typedef typename Chrom::Fitness Fitness;
};
//-----------------------------------------------------------------
template<class Chrom> class Tournament: public Select<Chrom>
{
public:
struct Pair: public pair<unsigned, Fitness>
{
Pair(unsigned r, Fitness f = Fitness()) {} // error line
};
};
//----------------------------------------------------------------
main()
{
}
//----------------------------------------------------------------
PS: the error disappear when deleting "= Fitness()" in the declaration
of Pair.