memory hole in egcs or ginac
Richard B. Kreckel
kreckel at ThEP.Physik.Uni-Mainz.DE
Thu Aug 3 09:27:33 CEST 2000
On 2 Aug 2000, Paul Grayson wrote:
> The following program uses up all of my RAM in about 20 seconds:
> ------------------------------
> #include <ginac/ginac.h>
> using namespace GiNaC;
>
> int main() {
> while(1) symbol x("x");
> }
> ------------------------------
>
> ...and here's how I compile it:
> (using an fresh-out-of-the-box ./configure'd GiNaC)
> ------------------------------
> capibara$ c++ -dumpversion
> egcs-2.91.66
> capibara$ c++ -dumpmachine
> i386-slackware-linux
> capibara$ c++ try.cc -lcln -lginac -o try
> capibara$ try
> [memory usage goes up and up...]
> ------------------------------
>
> If I compile it with this line instead, I have no similar problem:
>
> while(1) basic x = symbol("x");
>
> ...any ideas? Am I confused about C++ (likely), or do I just have an
> old, buggy version of egcs, or is there a problem here?
I just tried it with an old egcs "gcc version egcs-2.91.60 Debian 2.1
(egcs-1.1.1 release)" and a new gcc "gcc version 2.95.2 20000220 (Debian
GNU/Linux)". I can indeed see memory explode using egcs but not with gcc.
This suggests the problem is with your compiler.
Regards
-richy.
--
Richard B. Kreckel
<Richard.Kreckel at Uni-Mainz.DE>
<http://wwwthep.physik.uni-mainz.de/~kreckel/>
More information about the GiNaC-devel
mailing list