[GHC] #12804: forever contains a space leak

#12804: forever contains a space leak -------------------------------------+------------------------------------- Reporter: tomjaguarpaw | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: | Version: 8.0.1 libraries/base | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Runtime Unknown/Multiple | performance bug Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- 4.9.0.0's `forever` (implemented in terms of `Applicative`) has a space leak for certain base `Monad`s. The old `forever` (implemented in terms of `Monad`) does not. See these messages for details * https://mail.haskell.org/pipermail/haskell-cafe/2016-October/125177.html * https://mail.haskell.org/pipermail/haskell-cafe/2016-October/125178.html * https://mail.haskell.org/pipermail/haskell- cafe/2016-November/125443.html This is not necessarily `forever`'s fault. It seems likely that the broken behaviour that occurs with `ReaderT` and `StateT` (on `IO`) could be fixed by a specialised implementation of `*>` (for `ReaderT` and `StateT`). Perhaps, then, this bug should ultimately be fixed in `transformers` (and various other packages which supply `Applicative`s) but it is a regression introduced by base-4.9.0.0 so I think it's worthwhile to discuss here. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12804 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12804: forever contains a space leak -------------------------------------+------------------------------------- Reporter: tomjaguarpaw | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by tomjaguarpaw): I confirm that the space leak is gone for `ReaderT` of `IO` if I define {{{#!hs f *> v = ReaderT $ \ r -> runReaderT f r *> runReaderT v r }}} I presume (but haven't checked) that the space leak is also gone for `StateT` of `IO` if the corresponding implementation for `*>` is given in the `Applicative` instance. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12804#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12804: forever contains a space leak -------------------------------------+------------------------------------- Reporter: tomjaguarpaw | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * cc: ekmett, core-libraries-committee@… (added) Comment: Adding Edward and the core libraries committee; it's their territory. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12804#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12804: forever contains a space leak -------------------------------------+------------------------------------- Reporter: tomjaguarpaw | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by tomjaguarpaw): Ultimately I conclude that the issue lies in `transformers`, not `base`. I filed this issue on `transformers`: http://hub.darcs.net/ross/transformers/issue/33 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12804#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12804: forever contains a space leak -------------------------------------+------------------------------------- Reporter: tomjaguarpaw | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): The `transformers` patch has been merged. Let's hope that Ross releases soon. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12804#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12804: forever contains a space leak -------------------------------------+------------------------------------- Reporter: tomjaguarpaw | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: libraries/base | Version: 8.0.1 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => invalid -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12804#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC