Hi Ian,

On Mar 29, 2007, at 8:36 PM, Ian Lynagh wrote:


Hmm, oh well.

OK, so we know that the wrong value is being passed to
newPinnedByteArray#, right? There aren't many calls to that:

    libraries/base/Foreign/Marshal/Alloc.hs
    libraries/base/GHC/ForeignPtr.hs (4 calls)
    libraries/base/GHC/Handle.hs

so the easiest way forward is probably to print something unique, and
the size passed, in each one and try to work backwards towards the
source. e.g.

    mallocPlainForeignPtrBytes (I# size) = IO $ \s ->
        case newPinnedByteArray# size s      of { (# s, mbarr# #) ->

    =>

    mallocPlainForeignPtrBytes i@(I# size) = do
      print ('A', i)
      IO $ \s ->
        case newPinnedByteArray# size s      of { (# s, mbarr# #) ->

(it might be worth printing something after the existing IO action as
well, just to avoid confusion as to what is happening.



Is there a version of "print" I can use for debugging these libraries?
Just adding "print" causes a cycle in module dependencies.

I can now start gdb instruction stepping close to the crash and it looks
as if the trouble comes from mallocForeignPtr.  I'm trying to find out
what calls that now.

Best Wishes,
Greg

_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to