leaky: Robust space leak, and its strictification

[ bsd3, program, testing ] [ Propose Tags ]

Robust space leak, and its strictification, for testing deepseq-bounded and seqaid.

See also the project homepage for more information.

Please share your comments on this reddit discussion.

NOTE: Ignore the anonymous rogue failed build report below. If you examine the log it's clear that the problem is theirs, and nothing to do with this package or its dependencies. It's a shame this is so prominently displayed and impossible to remedy, it makes unbroken packages seem broken to visitors, and it exerts negative pressure on the use of cpphs and other build-tools.


[Skip to Readme]
Versions [faq] 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4, 0.1.0.5, 0.1.6.0, 0.1.7.0, 0.2.0.0, 0.2.0.1, 0.2.1.0, 0.2.1.1, 0.3.0.0, 0.3.0.1, 0.3.0.2, 0.3.0.3, 0.4.0.0
Change log changelog.txt
Dependencies base (==4.*), cpphs (>1.14), deepseq-bounded (>=0.6 && <0.8), deepseq-generics (==0.1.*), generics-sop (==0.1.*), random (==1.1), seqaid (==0.3.0.*), template-haskell [details]
License BSD-3-Clause
Author Andrew G. Seniuk
Maintainer Andrew Seniuk <rasfar@gmail.com>
Revised Revision 1 made by AndrewSeniuk at Sun Feb 1 13:04:23 UTC 2015
Category Testing
Home page http://fremissant.net/leaky
Bug tracker http://fremissant.net/leaky/trac
Uploaded by AndrewSeniuk at Sun Feb 1 08:37:30 UTC 2015
Distributions NixOS:0.4.0.0
Executables leaky
Downloads 6477 total (161 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs not available [build log]
All reported builds failed as of 2016-12-11 [all 7 reports]

Flags

NameDescriptionDefaultType
hello_hackage_visitor
Note to those reading on Hackage:
Please ignore these flags, which would be better presented in a collapsed state. The flags are mostly for development purposes.
DisabledManual
turn_on_seqaid_plugin

Only when True, provide the options to enable the seqaid preprocessor and GHC plugin.

EnabledManual
omnitypic

Blanket seqaid harness at subexpressions of all possible types. Shouldn't need a Cabal flag for this, but it's the same problem of casing over integer values for a macro (in a .cabal file). So this need not be orthogonal to FORCING_STRATEGY, but this way it is ... which is okay, actually. (Can then test interactions with other FS=0..6.)

DisabledManual
test_seqaidpp

Finally crumbed and availed myself of -F -pgmF, although only for things which are fairly safe via regex (injecting imports, top-level splices, "deriving instance" statements, LANGUAGE pragmas, etc.). (Later: You can't really do without this anymore, although with FORCING_STRATEGY=4 it is possible.)

EnabledManual
stats

Dump periodic stats lines, for FORCING_STRATEGY that need it.

EnabledManual
using_sandbox

I use them, but it's not default because it makes for much longer initial build, as all the dependencies (except base libs) need first to be installed into the sandbox.

DisabledManual
use_second_module

Temporary for testing... (Later: Sadly this is not so temporary. There is some kind of interference between SOP.TH and Seqaid.TH splices which is still unresolved. So, types needing NFDataP (etc.) instances will need to live in a module which is not being harnessed.)

EnabledManual
profile

Enable profiling

DisabledManual
use_growing_list

The problem with using a growing list is, it itself is a leak (as it were), so it's hard to see you've plugged anything. However, the slowdown of "force" relative to "forcep" will be noticed! Alternative to GROWING is FIXED (is at length 10000 at the moment). Fixed list is infinite if INFINITE set below. (INFINITE has no effect when GROWING set.)

EnabledManual
use_growing_list_reduction

XXX For some reason, memory is being retained when REDUCTION is enabled. (Later: Is this still the case? I see it's been set to True throughout development...).

EnabledManual
use_infinite_list

To show DeepSeq.force (FORCING_STRATEGY=1) at its worst.

DisabledManual
use_strict_blob

Put some weighty strict subtrees in the test data structure, so can showcase forcep's specificity relative to forcen.

EnabledManual
use_cpphs

Non-manual flag to allow the build system to try cpphs first, and if that fails, then to try system-wide cpp (typically GNU). I've actually toggled the default, so the build system will try for a system-wide cpp first, and failing that, will try to use cpphs, installing it if necessary. I prefer cpp. I am not getting my most invaluable -Wundef option with cpphs using -optP-Wundef -optP--cpp in my ghc-options. Does cpphs implement it? Not sure...

DisabledAutomatic
cowboy

Non-manual flag to try to respond to rogue build failure reports but misconfigured auto-build systems.

DisabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

For package maintainers and hackage trustees


Readme for leaky-0.3.0.1

[back to package description]

This leaky mini-project provides a Haskell program exhibiting classic
space leak behaviour.  It leaks in GHC 7.8.3 (and lower), even when
compiled -O2.


  leaky-min-cppd.hs  - a tiny Haskell program that leaks in GHC 7.8.3 -O2
  leaky-min.hs       - like leaky-min-cppd.hs, with some alternatives
  leaky.hs           - a similar but elaborated example, with .cabal flags


In addition to the source files, more information can be found
at the http://www.fremissant.net/leaky project homepage,
including discussion links (cafe, reddit, etc.).

There may also be a community-editable version at the
https://www.haskell.org/haskellwiki/Space_Leak wiki page.


Configure and build in place:

 >  cabal get leaky                     # download and unpack leaky
 >  cd leaky-0.1.0.0                    # (or whatever version it is)
 >  cabal configure && cabal build      # build in place

Run by supplying a seed for the random number generator:

 >  ./dist/build/leaky/leaky 234


Or you may prefer to build in a sandbox:

 >  cabal get leaky
 >  cd leaky-0.1.0.0
 >  cabal sandbox init
 >  cabal install --only-dependencies
 >  cabal install

And to run:

 >  ./.cabal-sandbox/bin/leaky 234


NOTE: If you don't build with Cabal, you will need to
put options from leaky.cabal into your command line.

Anyway, seqaid uses both the Cabal library and
the cabal executable, meaning that only FORCING_STRATEGY
from 0 through 3 (refer to leaky.cabal) can work
wtihout the presence of the leaky.cabal file.


The output is explained at http://www.fremissant.net/leaky/output.html
or in the corresponding local document ./HTML/output.html.


The FORCING_STRATEGY CPP macro currently controls the leak and plug
variants, which are best set by editing the leaky.cabal file,reconfiguring
and rebuilding (or reinstalling in the case of a sandbox).  See the
included file rough-fs-twiddling-guide.txt for more details.

There are also some constants in leaky.hs you may like to adjust.


If you have a version of the compiler that does not leak for
the default variant of leaky, please let me know at rasfar@gmail.com,
or on the reddit discussion:

  http://www.reddit.com/r/haskell/comments/2pscxh/ann_deepseqbounded_seqaid_leaky/

It's nice to share your thoughts.


Sept. 20, 2014 / Dec. 2014
Andrew Seniuk
rasfar on #haskell