More on FreeBSD/amd64
Gregory Wright
gwright at comcast.net
Sun Apr 1 15:40:11 EDT 2007
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
More information about the Glasgow-haskell-users
mailing list