Opened 6 years ago

Closed 5 years ago

#8960 closed bug (fixed)

SpecConstr usage explodes beyond 4GB with GHC 7.8.1 rc 2

Reported by: MichalGajda Owned by:
Priority: high Milestone: 7.8.4
Component: Compiler Version: 7.8.1-rc2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case: cabal install hPDB
Blocked By: Blocking:
Related Tickets: #7068, #7898 Differential Rev(s):
Wiki Page:


GHC 7.8 rc2 exhausts all memory on Bio.PDB.EventParser.PDBEventParser module in -O3 mode, but not in -O2 mode.

The tail of -v3 input seems to indicate that it dies during SpecConstr phase. The module successfully compiled with below 2GB RAM since GHC 6.12, so I wonder why the memory use exploded with the most recent version.

* SpecConstr:

==================== SpecConstr ==================== Result size of SpecConstr


  1. cabal install hPDB

RESULT EXPECTED: Successful compilation and installation

CURRENT RESULT: Exhausts available memory and crashes when compiling Bio.PDB.EventParser.PDBEventParser.

Change History (10)

comment:1 Changed 6 years ago by MichalGajda

Note that -O3 is indicated as default build parameter in the package .cabal file.

comment:2 Changed 6 years ago by quantheory

I guess SpecConstr seems to cause this sort of problem at times, so adding related bugs.

I'm confused about -O2 vs. -O3, though. I thought that -O2 was the maximum, so -O3 and -O2 should be exactly the same?

comment:3 Changed 6 years ago by quantheory

comment:4 Changed 5 years ago by thoughtpolice

Priority: normalhigh

comment:5 Changed 5 years ago by George

Works for me on 64 bit 7.8.2 on MacOS. I have 12gb RAM but that shouldn't matter, the max heap setting should be the determining factor, right? But what is the max heap when you use cabal install? I assume it is the ghc default. Does this vary with the amount of RAM the system has?

 ghc --info
 [("Project name","The Glorious Glasgow Haskell Compilation System")
 ,("GCC extra via C opts"," -fwrapv")
 ,("C compiler command","/usr/local/bin/gcc")
 ,("C compiler flags"," -m64 -fno-stack-protector")
 ,("C compiler link flags"," -m64")
 ,("ld command","/usr/bin/ld")
 ,("ld flags"," -arch x86_64")
 ,("ld supports compact unwind","YES")
 ,("ld supports build-id","NO")
 ,("ld supports filelist","YES")
 ,("ld is GNU ld","NO")
 ,("ar command","/usr/bin/ar")
 ,("ar flags","clqs")
 ,("ar supports at file","NO")
 ,("touch command","touch")
 ,("dllwrap command","/bin/false")
 ,("windres command","/bin/false")
 ,("libtool command","libtool")
 ,("perl command","/usr/bin/perl")
 ,("target os","OSDarwin")
 ,("target arch","ArchX86_64")
 ,("target word size","8")
 ,("target has GNU nonexec stack","False")
 ,("target has .ident directive","True")
 ,("target has subsections via symbols","True")
 ,("LLVM llc command","llc")
 ,("LLVM opt command","opt")
 ,("Project version","7.8.2")
 ,("Booter version","7.6.3")
 ,("Build platform","x86_64-apple-darwin")
 ,("Host platform","x86_64-apple-darwin")
 ,("Target platform","x86_64-apple-darwin")
 ,("Have interpreter","YES")
 ,("Object splitting supported","YES")
 ,("Have native code generator","YES")
 ,("Support SMP","YES")
 ,("Tables next to code","YES")
 ,("RTS ways","l debug thr thr_debug thr_l thr_p dyn debug_dyn thr_dyn thr_debug_dyn l_dyn thr_l_dyn")
 ,("Support dynamic-too","YES")
 ,("Support parallel --make","YES")
 ,("Dynamic by default","NO")
 ,("GHC Dynamic","YES")
 ,("Leading underscore","YES")
 ,("Debug on","False")
 ,("Global Package DB","/usr/local/lib/ghc-7.8.2/package.conf.d")
Last edited 5 years ago by George (previous) (diff)

comment:6 Changed 5 years ago by thoughtpolice


Moving to 7.8.4.

comment:7 Changed 5 years ago by simonpj

I believe this is finally fixed; see #8852. Can you try now, with HEAD?


comment:8 Changed 5 years ago by thoughtpolice

Resolution: fixed
Status: newclosed

This looks like it's now fixed in HEAD.

comment:9 Changed 5 years ago by thoughtpolice

Status: closedmerge

comment:10 Changed 5 years ago by thoughtpolice

Status: mergeclosed

Merged to ghc-7.8.

Note: See TracTickets for help on using tickets.