[Haskell-cafe] Issues with Marshalling arrays of user defined types

lonetiger at gmail.com lonetiger at gmail.com
Sun Aug 17 12:05:50 UTC 2014


Hi All,


I’ve been scratching my head for weeks trying to figure out what goes wrong with the code pasted below.


It’s compiled to a shared library (dll) on windows. I know the Storable instance is correct because calls to testFooA works, but calls to testFooListA get an invalid pointer back.


Lists of Ints do work fine, so it seems that newArray is also working. In GHCi it can dereference the pointer. And this used to work before in earlier GHC 7.0 and later 6.6 builds.


Using WinDBG and gflags I see that the pointer is indeed invalid, but that the *valid* data is there in the heap.


The example code can be found at http://lpaste.net/6148884045213204480


Anyone have an idea what I’m doing wrong?


Kind Regards,

Tamar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140817/b21efea9/attachment.html>


More information about the Haskell-Cafe mailing list