Armin Groesslinger wrote:
> I think I have found a memory leak in GHC/FFI. [...]

I think it's problem with stable pointers. You can start the following
program several times and get several funny results, ranging from a
sudden but silent death at different values of count with return
value 1 to

   Fail: resource exhausted
   Action: writeChunks
   Reason: argument list too long
 
(ghc-4.05 from CVS on Linux).

----------------------------------------
import Stable

loop :: Int -> IO ()
loop count = do 
   p <- makeStablePtr count
   print count
   loop (count+1)

main :: IO ()
main = loop 1
----------------------------------------

Cheers,
   Sven
-- 
Sven Panne                                        Tel.: +49/89/2178-2235
LMU, Institut fuer Informatik                     FAX : +49/89/2178-2211
LFE Programmier- und Modellierungssprachen              Oettingenstr. 67
mailto:[EMAIL PROTECTED]            D-80538 Muenchen
http://www.informatik.uni-muenchen.de/~Sven.Panne

Reply via email to