Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-18 Thread Bertram Felgenhauer
Bulat Ziganshin wrote: This expands as always a = a always a = a a always a = a a a always a ... where each application is represented by a newly allocated object (or several, I have not looked at it in detail) on the heap. why

Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-17 Thread Jesper Louis Andersen
On Sat, Apr 17, 2010 at 12:00 AM, Jason Dagit da...@codersbase.com wrote: Myself and others posted simpler programs that had similar bad behavior, including the space leak (depending on optimizations flags).  I realize it's tedious to retest all those versions, but do you think you could check

RE: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-17 Thread Simon Peyton-Jones
test case, do submit a Trac ticket. Simon From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Jason Dagit Sent: 14 April 2010 22:50 To: Gregory Collins Cc: Haskell Cafe Subject: Re: [Haskell-cafe] GHC, odd concurrency space leak On Wed, Apr 14, 2010

Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-17 Thread Adam Vogt
* On Wednesday, April 14 2010, Jesper Louis Andersen wrote: newtype Process a b c = Process (ReaderT a (StateT b IO) c) deriving (Functor, Monad, MonadIO, MonadState b, MonadReader a) Note that the automatic derivations of *MonadState b* and *MonadReader a* makes GHC spit our some

Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-17 Thread Daniel Fischer
Am Samstag 17 April 2010 14:41:28 schrieb Simon Peyton-Jones: I have not been following the details of this, I'm afraid, but I notice this: forever' m = do _ - m forever' m When I define that version of forever, the space leak goes away. What was the old version of

Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-17 Thread Bertram Felgenhauer
Daniel Fischer wrote: Am Samstag 17 April 2010 14:41:28 schrieb Simon Peyton-Jones: I have not been following the details of this, I'm afraid, but I notice this: forever' m = do _ - m forever' m When I define that version of forever, the space leak goes away.

Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-17 Thread Daniel Fischer
Am Samstag 17 April 2010 22:11:05 schrieb Bertram Felgenhauer: Daniel Fischer wrote: Am Samstag 17 April 2010 14:41:28 schrieb Simon Peyton-Jones: I have not been following the details of this, I'm afraid, but I notice this: forever' m = do _ - m forever' m

Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-17 Thread Bertram Felgenhauer
Bulat Ziganshin wrote: Hello Bertram, Sunday, April 18, 2010, 12:11:05 AM, you wrote: always a = -- let act = a act in act do _ - a always a hinting at the real problem: 'always' actually creates a long chain of actions instead of tying the

Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-17 Thread Bertram Felgenhauer
Daniel Fischer wrote: Except that with optimisations turned on, GHC ties the knot for you (at least if always isn't exported). Without -fno-state-hack, the knot is tied so tightly that always (return ()) is never descheduled (and there's no leak). Yes, I was concentrating on -O2, without

Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-17 Thread Daniel Fischer
Am Sonntag 18 April 2010 02:05:30 schrieb Bertram Felgenhauer: Which is     always = \a_aeO - let k_sYz = always a_aeO                        in  a_aeO k_sYz specialised to IO, and with () inlined. Where is the knot? Nowhere. Got confused by all the a_aAe and `cast` (GHC.Types...).

Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-16 Thread Jesper Louis Andersen
On Thu, Apr 15, 2010 at 1:33 AM, Daniel Fischer daniel.is.fisc...@web.de wrote: Can some core expert please look at these and explain the difference? I'm interested in an explanation too. +1 The behaviour is consistent. GHC 6.8.3, 6.10.4, 6.12.1 and 6.13-20100416 all agree on the space

Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-16 Thread Jason Dagit
On Fri, Apr 16, 2010 at 2:51 PM, Jesper Louis Andersen jesper.louis.ander...@gmail.com wrote: On Thu, Apr 15, 2010 at 1:33 AM, Daniel Fischer daniel.is.fisc...@web.de wrote: Can some core expert please look at these and explain the difference? I'm interested in an explanation too.

Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-15 Thread Neil Brown
Jason Dagit wrote: On Wed, Apr 14, 2010 at 3:13 PM, Daniel Fischer daniel.is.fisc...@web.de mailto:daniel.is.fisc...@web.de wrote: Am Mittwoch 14 April 2010 23:49:43 schrieb Jason Dagit: It will be interesting to hear what fixes this! forever' m = do _ - m

Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-14 Thread Gregory Collins
Jesper Louis Andersen jesper.louis.ander...@gmail.com writes: This post describes some odd behaviour I have seen in GHC 6.12.1 when writing Combinatorrent. The post is literate Haskell so you can run it. The executive summary: A space leak occurs when a new process is spawned from inside

Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-14 Thread Jason Dagit
On Wed, Apr 14, 2010 at 2:13 PM, Gregory Collins g...@gregorycollins.netwrote: Jesper Louis Andersen jesper.louis.ander...@gmail.com writes: This post describes some odd behaviour I have seen in GHC 6.12.1 when writing Combinatorrent. The post is literate Haskell so you can run it. The

Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-14 Thread Jason Dagit
On Wed, Apr 14, 2010 at 2:44 PM, Jason Dagit da...@codersbase.com wrote: On Wed, Apr 14, 2010 at 2:13 PM, Gregory Collins g...@gregorycollins.netwrote: Jesper Louis Andersen jesper.louis.ander...@gmail.com writes: This post describes some odd behaviour I have seen in GHC 6.12.1 when

Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-14 Thread Daniel Fischer
Am Mittwoch 14 April 2010 23:13:13 schrieb Gregory Collins: Jesper Louis Andersen jesper.louis.ander...@gmail.com writes: This post describes some odd behaviour I have seen in GHC 6.12.1 when writing Combinatorrent. The post is literate Haskell so you can run it. The executive summary: A

Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-14 Thread Daniel Fischer
Am Mittwoch 14 April 2010 23:49:43 schrieb Jason Dagit: It will be interesting to hear what fixes this! forever' m = do _ - m                 forever' m When I define that version of forever, the space leak goes away. Not with optimisations.

Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-14 Thread Jason Dagit
On Wed, Apr 14, 2010 at 3:13 PM, Daniel Fischer daniel.is.fisc...@web.dewrote: Am Mittwoch 14 April 2010 23:49:43 schrieb Jason Dagit: It will be interesting to hear what fixes this! forever' m = do _ - m forever' m When I define that version of forever, the

Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-14 Thread Daniel Fischer
Am Donnerstag 15 April 2010 00:52:22 schrieb Jason Dagit: The bad version, ghc --make NonTermination.hs: \begin{code} {-# OPTIONS -O2 #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} -- Note: Change the optimization to -O1 to get a terminating version Doesn't seem to terminate with -O1 here