Memory leak in FFI callback: GHC 6.6

I'm not sure if this is a bug, but it sure seems that way to me. When using
the "wrapper" technique for creating a Haskell callback function it seems
that freeHaskellFunPtr is not properly freeing the resource.
Here is an example program

Dear SevenThunders (if that is how you like to addressed)
Thanks for extracting a small program that exhibits the leak; that is
really helpful. We'll look into it. Would you like to create a Trac bug
and attach your files?
Simon
| -----Original Message-----
| From: glasgow-haskell-users-bounces@haskell.org
[mailto:glasgow-haskell-users-bounces@haskell.org]
| On Behalf Of SevenThunders
| Sent: 03 November 2006 02:54
| To: glasgow-haskell-users@haskell.org
| Subject: Memory leak in FFI callback: GHC 6.6
|
|
| I'm not sure if this is a bug, but it sure seems that way to me. When
using
| the "wrapper" technique for creating a Haskell callback function it
seems
| that freeHaskellFunPtr is not properly freeing the resource.
|
| Here is an example program
|

Simon Peyton-Jones wrote:
Dear SevenThunders (if that is how you like to addressed)
Thanks for extracting a small program that exhibits the leak; that is really helpful. We'll look into it. Would you like to create a Trac bug and attach your files?
Simon
You can call me Matthew. The bug, if that's what it is, is now ticket number 985. By the way, why can't I get the callback to actually work in this example? If I for example uncomment the line -- pd <- cfunc pcf and say print out the value of pd, I get garbage values. Should I have used CDouble? I think for windows HsDouble = double in C land. -- View this message in context: http://www.nabble.com/Memory-leak-in-FFI-callback%3A-GHC-6.6-tf2565446.html#... Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabble.com.

Matthew Thanks for submitting the Trac bug. I don't know what the answer to your qn below is, but maybe someone else on ghc-users does. Meanwhile, I added the qn to the bug report. Simon | -----Original Message----- | From: glasgow-haskell-users-bounces@haskell.org [mailto:glasgow-haskell-users-bounces@haskell.org] | On Behalf Of SevenThunders | Sent: 03 November 2006 19:04 | To: glasgow-haskell-users@haskell.org | Subject: RE: Memory leak in FFI callback: GHC 6.6 | | | | Simon Peyton-Jones wrote: | > | > Dear SevenThunders (if that is how you like to addressed) | > | > Thanks for extracting a small program that exhibits the leak; that is | > really helpful. We'll look into it. Would you like to create a Trac bug | > and attach your files? | > | > Simon | > | > | > | | You can call me Matthew. The bug, if that's what it is, is now ticket | number 985. By the way, why can't I get the callback to actually work in | this example? If I for example uncomment the line | -- pd <- cfunc pcf | | and say print out the value of pd, I get garbage values. | | Should I have used CDouble? I think for windows HsDouble = double in C | land. | -- | View this message in context: http://www.nabble.com/Memory-leak-in-FFI-callback%3A-GHC-6.6- | tf2565446.html#a7165550 | Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabble.com. | | _______________________________________________ | Glasgow-haskell-users mailing list | Glasgow-haskell-users@haskell.org | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
participants (2)
-
SevenThunders
-
Simon Peyton-Jones