[Carpet] memory leak while running with carpet

Jonathan Thornburg jthorn at aei.mpg.de
Tue Jul 17 08:18:00 CEST 2007


Hi,

[[memory leaks in a Carpet run]]

On Mon, 16 Jul 2007, Yosef Zlochower wrote:
>   I believe I tracked the problem down to the  compiler.  I don't see any
> evidence of the memory leak while using the Intel version 10.0 compilers,
> but do see the problem when using the pathscale version 3.0 compiler.
> I found that the the pathscale compiler produced the memory leak both
> with aggressive optimizations
>  -O3 -OPT:Ofast -fno-math-errno -ffast-math
> and with the less aggressive
>  -O2
[[...]]

Unfortunately, this isn't enough for us to infer that the problem
is with the pathscale compiler.  An alternative hypothesis (which is
also consistent with the observations) would be that there's a bug in
one or more of {libc,mpi,C++ runtime library,Carpet,Cactus flesh,some thorn},
which trips up one compiler but not the other.  That is, even if the
bug goes away at (say) -O0 or switching compilers, that doesn't necessarily
mean that the bug was with the -O3 or the other compiler -- it might be
a bug somewhere else which just happens to get exposed at -O3 but not
at -O0.

[[
A classic example of this sort of bug is violation of the C/C++ standards'
aliasing and casting rules.  Alas, the Cactus flesh used to do some of
this, using unions to convert 'const cGH*' to 'cGH*' in ways which the
standards specifically say are *not* guaranteed to work.  In practice,
this usually means they work fine for a non-aggressive compiler at -O0,
but they don't work for an aggressive optimizer and -O99.

I _think_ we've now fixed the worst of these aliasing bugs in the flesh,
but I am certainly *not* sure we've got them all...
]]

ciao,

-- 
-- Jonathan Thornburg (remove -animal to reply) <J.Thornburg at soton.ac-zebra.uk>
   School of Mathematics, U of Southampton, England
   "Washing one's hands of the conflict between the powerful and the
    powerless means to side with the powerful, not to be neutral."
                                      -- quote by Freire / poster by Oxfam


More information about the developers mailing list