-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flatMap is broken for parallel collections in 2.9.0 & 2.9.0-1 #4678
Comments
Imported From: https://issues.scala-lang.org/browse/SI-4678?orig=1
|
Rob Patro (robp) said: |
@dcsobral said: |
Rob Patro (robp) said: |
@axel22 said: |
Dan Peebles (mysteriousdan) said: scala> scala.util.Properties.versionString
res35: java.lang.String = version 2.9.1.final
scala> HashSet(1 to 100: _*).par.map(identity)
java.lang.ArrayIndexOutOfBoundsException: 256
at scala.collection.parallel.mutable.ParFlatHashTable$ParFlatHashTableIterator.scan(ParFlatHashTable.scala:36)
at scala.collection.parallel.mutable.ParFlatHashTable$ParFlatHashTableIterator.next(ParFlatHashTable.scala:53)
at scala.collection.parallel.AugmentedIterableIterator$class.map2combiner(RemainsIterator.scala:115)
at scala.collection.parallel.mutable.ParFlatHashTable$ParFlatHashTableIterator.map2combiner(ParFlatHashTable.scala:26)
at scala.collection.parallel.ParIterableLike$Map.leaf(ParIterableLike.scala:971)
at scala.collection.parallel.Tasks$Task$$anonfun$tryLeaf$1.apply$mcV$sp(Tasks.scala:66)
at scala.collection.parallel.Tasks$Task$class.tryLeaf(Tasks.scala:68)
at scala.collection.parallel.ParIterableLike$Map.tryLeaf(ParIterableLike.scala:968)
at scala.collection.parallel.AdaptiveWorkStealingTasks$TaskImpl$class.internal(Tasks.scala:179)
at scala.collection.parallel.AdaptiveWorkStealingForkJoinTasks$TaskImpl.internal(Tasks.scala:509)
at scala.collection.parallel.AdaptiveWorkStealingTasks$TaskImpl$class.compute(Tasks.scala:164)
at scala.collection.parallel.AdaptiveWorkStealingForkJoinTasks$TaskImpl.compute(Tasks.scala:509)
at scala.concurrent.forkjoin.RecursiveAction.exec(RecursiveAction.java:147)
at scala.concurrent.forkjoin.ForkJoinTask.quietlyExec(ForkJoinTask.java:422)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.mainLoop(ForkJoinWorkerThread.java:340)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:325) |
When the attached program below is run, it crashes with a horrific stack trace:
scala.collection.parallel.package$CompositeThrowable: Multiple exceptions thrown during a parallel computation: (java.lang.ArrayIndexOutOfBoundsException: 1074347069
. . .
Where the ellipses denote around 100 lines of exceptions. Playing with the N, and M values in the attached program affect the behavior. If they are both significantly smaller, then the program runs to completion and produces the expected results. I imagine there is some sort of error condition in the parallel logic, because, behind the scenes there are attempted accesses to outrageous array indices.
The text was updated successfully, but these errors were encountered: