internal error: throwTo: unrecognised why_blocked value
The attached file, built with reactive 0.9.6 with the change listed below (fix for reactive bug!#14 (closed)), exhibits some strange behaviour. When built with -threaded and run without +RTS -N, everything is fine. When run with +RTS -N2, it slows down dramatically (using <10% CPU on each of my cores) and eventually crashes with:
Main: internal error: throwTo: unrecognised why_blocked value
(GHC version 6.10.1 for x86_64_unknown_linux)
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
The change to reactive (from http://hpaste.org/12528#a2) is to replace snapshotWith in FRP/Reactive/PrimRecursive.hs with:
snapshotWith :: forall a b c t. Ord t =>
(a -> b -> c) -> EventG t a -> ReactiveG t b -> EventG t c
snapshotWith f es rs = listEG . zip (eats es) . zipWith f (evals es) $ rats rs (eats es)
evals :: EventG t a -> [a]
evals (Event (Future (Max MaxBound, _))) = []
evals (Event (Future (_, ~(v `Stepper` es)))) = v:evals es
eats :: EventG t a -> [t]
eats (Event (Future (Max MaxBound, ~(_ `Stepper` es)))) = []
eats (Event (Future (Max (NoBound t), ~(_ `Stepper` es)))) = t:eats es
eats (Event (Future (Max MinBound, ~(_ `Stepper` es)))) = eats es