scalaz/scalaz — Issue #40: StackOverflowError when traversing a Stream
Author: YoEight
Created: 2011-10-24 16:39:01+00:00
State: open

This code sample causes a SOE

Stream.from(1).take(10000).traverse(x => putStrLn(x.toString)).unsafePerformIO

Here is a stacktrace snippet:

at scala.collection.immutable.List.foreach(List.scala:45)
at scala.collection.TraversableOnce$class.addString(TraversableOnce.scala:285)
at scala.collection.immutable.List.addString(List.scala:45)
at scala.collection.TraversableOnce$class.mkString(TraversableOnce.scala:263)
at scala.collection.immutable.List.mkString(List.scala:45)
at scala.collection.TraversableOnce$class.mkString(TraversableOnce.scala:265)
at scala.collection.immutable.List.mkString(List.scala:45)
at scala.collection.TraversableOnce$class.mkString(TraversableOnce.scala:267)
at scala.collection.immutable.List.mkString(List.scala:45)
at scalaz.Identity$class.shows(Identity.scala:50)
at scalaz.Identity$$anon$1.shows(Identity.scala:169)
at filemanip.Gis$$anonfun$main$1.apply(Gis.scala:29)
at filemanip.Gis$$anonfun$main$1.apply(Gis.scala:29)
at scalaz.Traverse$$anon$4$$anonfun$traverse$6.apply(Traverse.scala:31)
at scalaz.Traverse$$anon$4$$anonfun$traverse$6.apply(Traverse.scala:31)
at scalaz.Foldable$$anon$13.foldRight(Foldable.scala:95)
at scalaz.Foldable$$anon$13$$anonfun$foldRight$6.apply(Foldable.scala:95)
at scalaz.Traverse$$anon$4$$anonfun$traverse$6.apply(Traverse.scala:31)
at scalaz.Traverse$$anon$4$$anonfun$traverse$6.apply(Traverse.scala:31)
at scalaz.Foldable$$anon$13.foldRight(Foldable.scala:95)
at scalaz.Foldable$$anon$13$$anonfun$foldRight$6.apply(Foldable.scala:95)
at scalaz.Traverse$$anon$4$$anonfun$traverse$6.apply(Traverse.scala:31)
at scalaz.Traverse$$anon$4$$anonfun$traverse$6.apply(Traverse.scala:31)
at scalaz.Foldable$$anon$13.foldRight(Foldable.scala:95)
at scalaz.Foldable$$anon$13$$anonfun$foldRight$6.apply(Foldable.scala:95)
at scalaz.Traverse$$anon$4$$anonfun$traverse$6.apply(Traverse.scala:31)
at scalaz.Traverse$$anon$4$$anonfun$traverse$6.apply(Traverse.scala:31)
at scalaz.Foldable$$anon$13.foldRight(Foldable.scala:95)
at scalaz.Foldable$$anon$13$$anonfun$foldRight$6.apply(Foldable.scala:95)
at scalaz.Traverse$$anon$4$$anonfun$traverse$6.apply(Traverse.scala:31)
at scalaz.Traverse$$anon$4$$anonfun$traverse$6.apply(Traverse.scala:31)
at scalaz.Foldable$$anon$13.foldRight(Foldable.scala:95)
at scalaz.Foldable$$anon$13$$anonfun$foldRight$6.apply(Foldable.scala:95)
at scalaz.Traverse$$anon$4$$anonfun$traverse$6.apply(Traverse.scala:31)
at scalaz.Traverse$$anon$4$$anonfun$traverse$6.apply(Traverse.scala:31)
at scalaz.Foldable$$anon$13.foldRight(Foldable.scala:95)
at scalaz.Foldable$$anon$13$$anonfun$foldRight$6.apply(Foldable.scala:95)
at scalaz.Traverse$$anon$4$$anonfun$traverse$6.apply(Traverse.scala:31)
at scalaz.Traverse$$anon$4$$anonfun$traverse$6.apply(Traverse.scala:31)
at scalaz.Foldable$$anon$13.foldRight(Foldable.scala:95)
at scalaz.Foldable$$anon$13$$anonfun$foldRight$6.apply(Foldable.scala:95)
at scalaz.Traverse$$anon$4$$anonfun$traverse$6.apply(Traverse.scala:31)

Regards