[GHC] #778: memory leak
GHC
trac at galois.com
Fri Jun 2 05:31:52 EDT 2006
#778: memory leak
-------------------------+--------------------------------------------------
Reporter: guest | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 6.4.3
Component: Compiler | Version: 6.4.2
Severity: normal | Resolution:
Keywords: memory | Difficulty: Unknown
Architecture: Unknown | Os: Linux
-------------------------+--------------------------------------------------
Comment (by dcoutts at gentoo.org):
The Gentoo GHC ebuild does partially use the users CFLAGS settings.
It uses a filtered set of CLAGS for building the .c parts of GHC, ie the
rts and an even more filtered set for building the .hs parts. -O2 and -O3
are currently allowed for the .c files. -O3 is only allowed if the user is
running the testing ~x86 / ~amd64 profiles. For 'stable' x86 and amd64
profiles only -O2 is allowed for the .c files.
For building the .hs files we only pass through abi flags to gcc, eg
things like -mcpu=ultrasparc.
So my suspicion in this case is that the bug is triggered by using -O3 in
CFLAGS when emerging dev-lang/ghc. If so it will probably be due to the
rts being compiled with gcc -O3. So either the rts is breaking some strict
rule that gcc is relying on for correct optimisation (eg strict aliasing),
or there is a mis-compilation bug in gcc-4.1.1.
So my reccomendation to the original bug reporter is to try re-emerging
with -O2 rather than -O3 in CFLAGS and see if the problem persists. It
would be helpful to know if that does fix the problem as if it does we'll
change the ghc ebuild to downgrade -O3 to -O2 to prevent this problem.
BTW, in future it would be better to report this kind of bug in the Gentoo
bugzilla first (so we can investigate if it's due to using an unstable
build environment and/or settings).
It might be interesting to try building the rts with gcc-4.1.1 and look to
see if it warns about any strict aliasing issues.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/778>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list