This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

[Fwd: memory leak in egcs-1.1.2]


 


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.




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