Hi Ian, On Apr 1, 2007, at 3:57 PM, Ian Lynagh wrote:
Hi Gregory,
Is there a version of "print" I can use for debugging these libraries? Just adding "print" causes a cycle in module dependencies.
Ah, remove the #if/#endif around the definition of "puts", its export, and the GHC.Pack import in libraries/base/GHC/Handle.hs
No such luck. I even copied "puts" into libraries/base/GHC/ ForeignPtr.hs but I still get I cycle because I need withCString to define "puts": Module imports form a cycle for modules: GHC.ForeignPtr imports: GHC.Show GHC.Err GHC.Ptr GHC.IOBase GHC.Base GHC.List Foreign.Storable Foreign.Ptr Foreign.C Control.Monad Foreign.C imports: Foreign.C.Error Foreign.C.String Foreign.C.Types Foreign.C.Error imports: GHC.Base GHC.Num GHC.IOBase Data.Maybe Foreign.Marshal.Error Foreign.C.String Foreign.C.Types Foreign.Ptr Foreign.Storable GHC.IOBase Foreign.C.String imports: GHC.Base GHC.IOBase GHC.Num GHC.Real GHC.List Data.Word Foreign.Storable Foreign.Ptr Foreign.C.Types Foreign.Marshal.Array Foreign.C.Types Data.Typeable imports: GHC.Arr GHC.Stable GHC.ForeignPtr GHC.Ptr GHC.STRef GHC.ST GHC.IOBase GHC.IOBase GHC.Real GHC.Float GHC.Num GHC.Err GHC.Show GHC.Base Data.List Data.Word Data.Int Data.Either Data.Maybe Data.HashTable Foreign.Marshal.Array imports: GHC.Base GHC.Err GHC.List GHC.Num GHC.IOBase Foreign.Marshal.Utils Foreign.Marshal.Alloc Foreign.Storable Foreign.Ptr Control.Monad Foreign.Marshal.Utils imports: GHC.Base GHC.Num GHC.Real GHC.IOBase Foreign.Marshal.Alloc Foreign.C.Types Foreign.Storable Foreign.Ptr Data.Maybe Foreign.Marshal.Alloc imports: GHC.Num GHC.Base GHC.Err GHC.Ptr GHC.Real GHC.IOBase Foreign.ForeignPtr Foreign.Storable Foreign.C.Types Foreign.Ptr Data.Maybe Foreign.ForeignPtr imports: GHC.ForeignPtr GHC.Err GHC.Num GHC.IOBase GHC.Base Foreign.Storable Foreign.Ptr <<ghc: 150783504 bytes, 23 GCs, 1498056/2873752 avg/max bytes residency (3 samples), 19M in use, 0.00 INIT (0.00 elapsed), 0.48 MUT (1.76 elapsed), 0.06 GC (0.07 elapsed) :ghc>> gmake[1]: *** [depend] Error 1 gmake: *** [boot] Error 1 gmake: Leaving directory `/tmp/ghc-6.4.2/libraries' GHC.ForeignPtr does seem to be the root of much evil, since everything seems to depend on it. Any other hints on how I could get some output? BTW, I have done some more tracing with gdb and I think I am a bit closer to the underlying bug. Before the bad call to newPinnedByteArray#, there are a number of calls to functions bound to libc's regex functions (e.g., regcomp, regexec). Since this is FreeBSD's libc, there may easily be differences from the much better tested glibc. It looks like the regex functions are being used to look up package names, since I thought I saw a call from somewhere in Cabal.Distribution. I need to check this once I get ghc-6.4.2 rebuilt. Best Wishes, Greg