#1992: 6.8.2 intermittent build failure on multiple OS X versions
----------------------+-----------------------------------------------------
Reporter: guest | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 6.8.3
Component: Compiler | Version: 6.8.2
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Architecture: Multiple
Os: MacOS X |
----------------------+-----------------------------------------------------
Comment (by gwright):
I suspect that this bug has been seen before. In early December,
Duncan Coutts sent a message to the Cabal list saying that he had
fixed a problem in which the ghc's version wasn't detected. I saw the
same thing when building 6.8.1 on Panther/ppc. It was caused by a
lock error on the temporary file that received the output of ghc
--numeric-version. (Cabal had caught the error and discarded it,
returning "" for the version string.) Duncan's patch was to move the
temporary file from the current directory to that returned by
getTemporaryDirectory. I tried a similar thing --- I just hard coded
"/tmp" as the temp file's directory --- but still got lock errors.
But it's been difficult to make this bug consistently reproducible.
The most repeatable setup has been to build in an eshell or just a
comint buffer running under Aquamacs. This fails almost every time
with a linker error complaining that libHShaskell98-1.0.1.0.a doesn't
have a table of contents. It looks like ranlib wasn't run on
it. Strangely, vanilla emacs 22.1 is OK. Building under MacPorts
fails about a quarter of the time, usually with a lock error.
MacPorts runs it scripts under a tclsh, but I've not been able to
reproduce the bug running under a bare tclsh.
I had thought that this might be related to the fix for bug #724,
which avoids putting file descriptors inherited from external
processes into nonblocking mode. I backed out the change and built a
new bootstrap compiler (using MacPorts), then built in an eshell under
Aquamacs a fresh tree that had the #724 change backed out. No dice.
The build still failed with a link error because ranlib had not been
run on libHShaskell98-1.0.1.0.a.
Here's one thing that may or may not be significant: when
libHShaskell-98 is registered, the build logs under Aquamacs and
bash/terminal show a different order of operations. Under
bash/terminal,
{{{
ar: creating archive dist/build/libHShaskell98-1.0.1.0.a
/usr/bin/ld -x -r -o dist/build/HShaskell98-1.0.1.0.o -L/opt/local/lib
dist/build/Array.o dist/build/CPUTime.o dist/build/Char.o
dist/build/Complex.o dist/build/Directory.o dist/build/IO.o
dist/build/Ix.o dist/build/List.o dist/build/Locale.o dist/build/Maybe.o
dist/build/Monad.o dist/build/Random.o dist/build/Ratio.o
dist/build/System.o dist/build/Time.o dist/build/Bits.o
dist/build/CError.o dist/build/CForeign.o dist/build/CString.o
dist/build/CTypes.o dist/build/ForeignPtr.o dist/build/Int.o
dist/build/MarshalAlloc.o dist/build/MarshalArray.o
dist/build/MarshalError.o dist/build/MarshalUtils.o dist/build/Ptr.o
dist/build/StablePtr.o dist/build/Storable.o dist/build/Word.o `find
dist/build -name "*_stub.o" -print`
Reading package info from "dist/inplace-pkg-config" ... done.
Saving old package config file... done.
Writing new package config file... done.
Registering haskell98-1.0.1.0...
create dist/inplace-pkg-config
("../../utils/ghc-pkg/ghc-pkg-inplace",["update","dist/inplace-pkg-
config"])
}}}
while Aquamacs shows
{{{
ar: creating archive dist/build/libHShaskell98-1.0.1.0.a
/usr/bin/ld -x -r -o dist/build/HShaskell98-1.0.1.0.o -L/opt/local/lib
dist/build/Array.o dist/build/CPUTime.o dist/build/Char.o
dist/build/Complex.o dist/build/Directory.o dist/build/IO.o
dist/build/Ix.o dist/build/List.o dist/build/Locale.o dist/build/Maybe.o
dist/build/Monad.o dist/build/Random.o dist/build/Ratio.o
dist/build/System.o dist/build/Time.o dist/build/Bits.o
dist/build/CError.o dist/build/CForeign.o dist/build/CString.o
dist/build/CTypes.o dist/build/ForeignPtr.o dist/build/Int.o
dist/build/MarshalAlloc.o dist/build/MarshalArray.o
dist/build/MarshalError.o dist/build/MarshalUtils.o dist/build/Ptr.o
dist/build/StablePtr.o dist/build/Storable.o dist/build/Word.o `find
dist/build -name "*_stub.o" -print`
Registering haskell98-1.0.1.0...
create dist/inplace-pkg-config
("../../utils/ghc-pkg/ghc-pkg-inplace",["update","dist/inplace-pkg-
config"])
Reading package info from "dist/inplace-pkg-config" ... done.
Saving old package config file... done.
Writing new package config file... done.
}}}
and the build fails shortly afterward when stage2 begins because
libHSHaskell98.a has no table of contents. Ranlib should have been
run by installLib (in Cabal/Distribution/Simple/GHC.hs), but for some
reason it wasn't. But the different order of output may not mean
anything. When I build under vanilla emacs I get the same order of
output as under Aquamacs, but the build succeeds.
I modified installLib to force the verbosity of calls to
rawSystemProgram to "deafening". This should have at least printed
out when ranlib was called. In this case, the build failed with a lock
error:
{{{
Creating main/Config.hs ...
done.
Creating stage1/ghc_boot_platform.h...
Done.
gcc -E -I/opt/local/include -undef -traditional -P -I../includes -x c
prelude/primops.txt.pp | \
grep -v '^#pragma GCC' > prelude/primops.txt
../utils/genprimopcode/genprimopcode --data-decl <
prelude/primops.txt > primop-data-decl.hs-incl
../utils/genprimopcode/genprimopcode --primop-tag <
prelude/primops.txt > primop-tag.hs-incl
../utils/genprimopcode/genprimopcode --primop-list <
prelude/primops.txt > primop-list.hs-incl
../utils/genprimopcode/genprimopcode --has-side-effects <
prelude/primops.txt > primop-has-side-effects.hs-incl
../utils/genprimopcode/genprimopcode --out-of-line <
prelude/primops.txt > primop-out-of-line.hs-incl
../utils/genprimopcode/genprimopcode --commutable <
prelude/primops.txt > primop-commutable.hs-incl
../utils/genprimopcode/genprimopcode --needs-wrapper <
prelude/primops.txt > primop-needs-wrapper.hs-incl
../utils/genprimopcode/genprimopcode --can-fail <
prelude/primops.txt > primop-can-fail.hs-incl
../utils/genprimopcode/genprimopcode --strictness <
prelude/primops.txt > primop-strictness.hs-incl
../utils/genprimopcode/genprimopcode --primop-primop-info <
prelude/primops.txt > primop-primop-info.hs-incl
touch .depend-BASE
/opt/local/bin/ghc -M -optdep-f -optdep.depend-BASE -osuf o -I../includes
-optdep--exclude-module=Compat.RawSystem -optdep--exclude-
module=Compat.Directory -optdep--exclude-module=Compat.Unicode -optdep
--exclude-module=Distribution.Compat.FilePath -optdep--exclude-
module=Distribution.Compat.ReadP -optdep--exclude-
module=Distribution.Extension -optdep--exclude-module=Distribution.GetOpt
-optdep--exclude-module=Distribution.InstalledPackageInfo -optdep
--exclude-module=Distribution.License -optdep--exclude-
module=Distribution.Package -optdep--exclude-
module=Distribution.ParseUtils -optdep--exclude-
module=Distribution.Compiler -optdep--exclude-module=Distribution.Version
-optdep--exclude-module=System.FilePath -optdep--exclude-
module=System.FilePath.Posix -optdep--exclude-
module=System.FilePath.Windows -optdep--exclude-
module=System.Directory.Internals -optdep--exclude-module=Trace.Hpc.Mix
-optdep--exclude-module=Trace.Hpc.Tix -optdep--exclude-
module=Trace.Hpc.Util -H128m -O -fasm -Rghc-timing -I/opt/local/include
-L/opt/local/lib -iutils -ibasicTypes -itypes -ihsSyn -iprelude -irename
-itypecheck -ideSugar -icoreSyn -ivectorise -ispecialise -isimplCore
-istranal -istgSyn -isimplStg -icodeGen -imain -iprofiling -iparser
-icprAnalysis -indpFlatten -iiface -icmm -inativeGen -Wall -fno-warn-name-
shadowing -fno-warn-orphans -Istage1 -cpp -fglasgow-exts -fno-generics
-Rghc-timing -I. -Iparser -package unix -ignore-package lang -recomp
-Rghc-timing -O0 -DDEBUG -W -H16M '-#include "cutils.h"' -DUSING_COMPAT
-i../compat -ignore-package Cabal -package directory -package pretty
-package containers basicTypes/BasicTypes.lhs basicTypes/DataCon.lhs
basicTypes/Demand.lhs basicTypes/Id.lhs basicTypes/IdInfo.lhs
basicTypes/Literal.lhs basicTypes/MkId.lhs basicTypes/Module.lhs
basicTypes/Name.lhs basicTypes/NameEnv.lhs basicTypes/NameSet.lhs
basicTypes/NewDemand.lhs basicTypes/OccName.lhs basicTypes/RdrName.lhs
basicTypes/SrcLoc.lhs basicTypes/UniqSupply.lhs basicTypes/Unique.lhs
basicTypes/Var.lhs basicTypes/VarEnv.lhs basicTypes/VarSet.lhs
cmm/CLabel.hs cmm/Cmm.hs cmm/CmmBrokenBlock.hs cmm/CmmCPS.hs
cmm/CmmCPSGen.hs cmm/CmmCallConv.hs cmm/CmmInfo.hs cmm/CmmLex.hs
cmm/CmmLint.hs cmm/CmmLive.hs cmm/CmmOpt.hs cmm/CmmParse.hs
cmm/CmmProcPoint.hs cmm/CmmUtils.hs cmm/Dataflow.hs cmm/MachOp.hs
cmm/PprC.hs cmm/PprCmm.hs codeGen/Bitmap.hs codeGen/CgBindery.lhs
codeGen/CgCallConv.hs codeGen/CgCase.lhs codeGen/CgClosure.lhs
codeGen/CgCon.lhs codeGen/CgExpr.lhs codeGen/CgForeignCall.hs
codeGen/CgHeapery.lhs codeGen/CgHpc.hs codeGen/CgInfoTbls.hs
codeGen/CgLetNoEscape.lhs codeGen/CgMonad.lhs codeGen/CgParallel.hs
codeGen/CgPrimOp.hs codeGen/CgProf.hs codeGen/CgStackery.lhs
codeGen/CgTailCall.lhs codeGen/CgTicky.hs codeGen/CgUtils.hs
codeGen/ClosureInfo.lhs codeGen/CodeGen.lhs codeGen/SMRep.lhs
coreSyn/CoreFVs.lhs coreSyn/CoreLint.lhs coreSyn/CorePrep.lhs
coreSyn/CoreSubst.lhs coreSyn/CoreSyn.lhs coreSyn/CoreTidy.lhs
coreSyn/CoreUnfold.lhs coreSyn/CoreUtils.lhs coreSyn/ExternalCore.lhs
coreSyn/MkExternalCore.lhs coreSyn/PprCore.lhs coreSyn/PprExternalCore.lhs
cprAnalysis/CprAnalyse.lhs deSugar/Check.lhs deSugar/Coverage.lhs
deSugar/Desugar.lhs deSugar/DsArrows.lhs deSugar/DsBinds.lhs
deSugar/DsCCall.lhs deSugar/DsExpr.lhs deSugar/DsForeign.lhs
deSugar/DsGRHSs.lhs deSugar/DsListComp.lhs deSugar/DsMonad.lhs
deSugar/DsUtils.lhs deSugar/Match.lhs deSugar/MatchCon.lhs
deSugar/MatchLit.lhs hsSyn/HsBinds.lhs hsSyn/HsDecls.lhs hsSyn/HsDoc.hs
hsSyn/HsExpr.lhs hsSyn/HsImpExp.lhs hsSyn/HsLit.lhs hsSyn/HsPat.lhs
hsSyn/HsSyn.lhs hsSyn/HsTypes.lhs hsSyn/HsUtils.lhs iface/BinIface.hs
iface/BuildTyCl.lhs iface/IfaceEnv.lhs iface/IfaceSyn.lhs
iface/IfaceType.lhs iface/LoadIface.lhs iface/MkIface.lhs
iface/TcIface.lhs main/BreakArray.hs main/CmdLineParser.hs
main/CodeOutput.lhs main/Config.hs main/Constants.lhs
main/DriverMkDepend.hs main/DriverPhases.hs main/DriverPipeline.hs
main/DynFlags.hs main/ErrUtils.lhs main/Finder.lhs main/GHC.hs
main/HeaderInfo.hs main/HscMain.lhs main/HscStats.lhs main/HscTypes.lhs
main/InteractiveEval.hs main/Main.hs main/PackageConfig.hs
main/Packages.lhs main/ParsePkgConf.hs main/PprTyThing.hs
main/StaticFlags.hs main/SysTools.lhs main/TidyPgm.lhs
nativeGen/AsmCodeGen.lhs nativeGen/GraphBase.hs nativeGen/GraphColor.hs
nativeGen/GraphOps.hs nativeGen/GraphPpr.hs nativeGen/MachCodeGen.hs
nativeGen/MachInstrs.hs nativeGen/MachRegs.lhs nativeGen/NCGMonad.hs
nativeGen/PositionIndependentCode.hs nativeGen/PprMach.hs
nativeGen/RegAllocColor.hs nativeGen/RegAllocInfo.hs
nativeGen/RegAllocLinear.hs nativeGen/RegAllocStats.hs
nativeGen/RegArchBase.hs nativeGen/RegArchX86.hs nativeGen/RegCoalesce.hs
nativeGen/RegLiveness.hs nativeGen/RegSpill.hs nativeGen/RegSpillClean.hs
nativeGen/RegSpillCost.hs ndpFlatten/FlattenInfo.hs
ndpFlatten/FlattenMonad.hs ndpFlatten/Flattening.hs
ndpFlatten/NDPCoreUtils.hs ndpFlatten/PArrAnal.hs parser/Ctype.lhs
parser/HaddockLex.hs parser/HaddockParse.hs parser/HaddockUtils.hs
parser/LexCore.hs parser/Lexer.hs parser/Parser.hs parser/ParserCore.hs
parser/ParserCoreUtils.hs parser/RdrHsSyn.lhs prelude/ForeignCall.lhs
prelude/PrelInfo.lhs prelude/PrelNames.lhs prelude/PrelRules.lhs
prelude/PrimOp.lhs prelude/TysPrim.lhs prelude/TysWiredIn.lhs
profiling/CostCentre.lhs profiling/SCCfinal.lhs rename/RnBinds.lhs
rename/RnEnv.lhs rename/RnExpr.lhs rename/RnHsDoc.hs rename/RnHsSyn.lhs
rename/RnNames.lhs rename/RnSource.lhs rename/RnTypes.lhs
simplCore/CSE.lhs simplCore/FloatIn.lhs simplCore/FloatOut.lhs
simplCore/LiberateCase.lhs simplCore/OccurAnal.lhs simplCore/SAT.lhs
simplCore/SATMonad.lhs simplCore/SetLevels.lhs simplCore/SimplCore.lhs
simplCore/SimplEnv.lhs simplCore/SimplMonad.lhs simplCore/SimplUtils.lhs
simplCore/Simplify.lhs simplStg/SRT.lhs simplStg/SimplStg.lhs
simplStg/StgStats.lhs specialise/Rules.lhs specialise/SpecConstr.lhs
specialise/Specialise.lhs stgSyn/CoreToStg.lhs stgSyn/StgLint.lhs
stgSyn/StgSyn.lhs stranal/DmdAnal.lhs stranal/SaAbsInt.lhs
stranal/SaLib.lhs stranal/StrictAnal.lhs stranal/WorkWrap.lhs
stranal/WwLib.lhs typecheck/FamInst.lhs typecheck/Inst.lhs
typecheck/TcArrows.lhs typecheck/TcBinds.lhs typecheck/TcClassDcl.lhs
typecheck/TcDefaults.lhs typecheck/TcDeriv.lhs typecheck/TcEnv.lhs
typecheck/TcExpr.lhs typecheck/TcForeign.lhs typecheck/TcGadt.lhs
typecheck/TcGenDeriv.lhs typecheck/TcHsSyn.lhs typecheck/TcHsType.lhs
typecheck/TcInstDcls.lhs typecheck/TcMType.lhs typecheck/TcMatches.lhs
typecheck/TcPat.lhs typecheck/TcRnDriver.lhs typecheck/TcRnMonad.lhs
typecheck/TcRnTypes.lhs typecheck/TcRules.lhs typecheck/TcSimplify.lhs
typecheck/TcTyClsDecls.lhs typecheck/TcTyDecls.lhs typecheck/TcTyFuns.lhs
typecheck/TcType.lhs typecheck/TcUnify.lhs types/Class.lhs
types/Coercion.lhs types/FamInstEnv.lhs types/FunDeps.lhs
types/Generics.lhs types/InstEnv.lhs types/TyCon.lhs types/Type.lhs
types/TypeRep.lhs types/Unify.lhs utils/Bag.lhs utils/Binary.hs
utils/BufWrite.hs utils/Digraph.lhs utils/Encoding.hs utils/FastMutInt.lhs
utils/FastString.lhs utils/FastTypes.lhs utils/FiniteMap.lhs
utils/IOEnv.hs utils/ListSetOps.lhs utils/Maybes.lhs utils/OrdList.lhs
utils/Outputable.lhs utils/Panic.lhs utils/Pretty.lhs utils/State.hs
utils/StringBuffer.lhs utils/UniqFM.lhs utils/UniqSet.lhs utils/Util.lhs
vectorise/VectBuiltIn.hs vectorise/VectCore.hs vectorise/VectMonad.hs
vectorise/VectType.hs vectorise/VectUtils.hs vectorise/Vectorise.hs
main/InteractiveEval.hs: openBinaryFile: resource busy (file is locked)
<<ghc: 167304936 bytes, 21 GCs, 1953792/3670016 avg/max bytes residency (3
samples), 19M in use, 0.01 INIT (0.00 elapsed), 0.23 MUT (2.65 elapsed),
0.04 GC (0.05 elapsed) :ghc>>
make[1]: *** [depend] Error 1
make: *** [stage1] Error 1
}}}
Just like playing whack-a-mole. The bug has now moved somewhere else.
The common factor may be process handing. I've been trying to use
dtrace to trace process (alas, ktrace is gone on
Leopard). Unfortunately, on OS X, dtrace is at best beta quality.
For example, you can not reliably get at least some of the arguments
to a process that is execve'd as you can on Solaris.
Since the error I can easily reproduce is the missed ranlib, I will
keep working with dtrace to try to get some kind of usable trace. I
am travelling and only have my MacBook running Leopard, but next week
I will have access to my wife's iBook running Panther. I can do a
ktrace with hers.
The debugging process has been slow since I'm building 6.8.2 with a
6.8.2 bootstrap compiler. When I make a patch, I rebuild the
bootstrap compiler until it succeeds, then do a test build. By
keeping the bootstrap compiler tree identical to the test tree I hope
to avoid chasing my tail with a buggy bootstrap. But if there are any
suggestions to safely speed up the process, I would welcome them.
Any hints as to what might have changed from 6.6 to 6.8 that might
cause this problem?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1992#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs