Re: Problem exporting Haskell to C via a DLL in GHC 6.6

2007-02-06 Thread SevenThunders
Brian Hulley wrote: > > > > Since Begin would be a function exported by the DLL, Windows would ensure > that the DLL was loaded when it is first called from your application if > it > was not already loaded so there would be no need for an explicit call to > LoadLibrary. > >> and then End

Re: Problem exporting Haskell to C via a DLL in GHC 6.6

2007-02-06 Thread SevenThunders
Simon Marlow-5 wrote: > > > I wonder if you're hitting this bug: > >http://hackage.haskell.org/trac/ghc/ticket/926 > > if so, it's slightly worrying that the same thing happens if you just link > your > program directly to the DLL, rather than loading it explicitly. > > Cheers, >

Re: Problem exporting Haskell to C via a DLL in GHC 6.6

2007-02-06 Thread SevenThunders
Brian Hulley wrote: > > SevenThunders wrote: >> Before I post this as a bug, I thought I'd check to make sure I'm not >> doing something wrong. >> BOOL >> STDCALL >> DllMain >> ( HANDLE hModule >> , DWORD reason >> ,

Problem exporting Haskell to C via a DLL in GHC 6.6

2007-02-05 Thread SevenThunders
Before I post this as a bug, I thought I'd check to make sure I'm not doing something wrong. For this test case, on my windows XP machine I create a simple Haskell routine that counts the characters in a file, create a DLL for that routine and call it from C. The C code gives the correct answer (

RE: Memory leak in FFI callback: GHC 6.6

2006-11-03 Thread SevenThunders
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? >

Memory leak in FFI callback: GHC 6.6

2006-11-02 Thread SevenThunders
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 module Main where import Foreign import Foreign.Ptr impor

Re: GHC 6.4.1 and Win32 DLLs: Bug in shutdownHaskell?

2006-10-24 Thread SevenThunders
SevenThunders wrote: > > > I just tried it under GHC 6.6 with the same results. If the DLL is loaded > it crashes when it's unloaded even if no Haskell code is actually > executed. > > Here is the promised simple example. This example will cause an exception whe

Re: GHC 6.4.1 and Win32 DLLs: Bug in shutdownHaskell?

2006-10-24 Thread SevenThunders
Michael Marte wrote: > > I am still using ghc 6.4.2 for creating my DLL and, as long as the DLL > does not open a file, releasing the DLL works fine. I have not yet tried > ghc 6.5. > > Michael > > > > I just tried it under GHC 6.6 with the same results. If the DLL is loaded it crashes w

Re: GHC 6.4.1 and Win32 DLLs: Bug in shutdownHaskell?

2006-10-23 Thread SevenThunders
Michael Marte wrote: > > Hello *, > > before filing a bug report, I want others to comment on my problem. > Maybe it's my fault, not ghc's. > > I wrapped up some Haskell modules in a Win32 DLL. > Loading the DLL dynamically (with LoadLibrary) works fine. However, > whether I actually use the