ANNOUNCE: MonadCatchIO-foreign

Evan Laforge qdunkan at gmail.com
Thu Jun 3 02:29:07 EDT 2010


On Sun, May 30, 2010 at 5:15 PM, Antoine Latter <aslatter at gmail.com> wrote:
> Hi GHC,
>
> Is there a reason that Foreign.Marshall.Array.allocaArray calls into
> allocaBytes instead of allocaBytesAligned? Since alloca needs the
> alignment, wouldn't allocaArray also need it?
>
> I'm not too up on how memory access is supposed to work, it was just
> something that jump out at me.

I've been waiting for a response on this, because I'm curious too, in
fact I always have been.  At the upgrade to 6.10, ghc suddenly started
using 'alignment' and all my programs which had defined it to
'undefined' since I didn't know what alignment was for and it didn't
seem to be used, started crashing.  So I dug around, dug up the '#let
alignment' macro boilerplate, and copy and pasted it around.

However, at the same time, my program started rarely but consistently
crashing with an assertion failure from the gc runtime.  I'm
suspicious of the inconsistent use of alignment, but it's hard to use
allocaBytesAligned since it's not exported, and the ffi lib is part of
ghc and it's not obvious how to modify it.


More information about the Glasgow-haskell-users mailing list