Skip to content
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

sliding puzzle exception for brute force sequential solver #25

Open
barrybecker4 opened this issue Jul 15, 2017 · 3 comments
Open

sliding puzzle exception for brute force sequential solver #25

barrybecker4 opened this issue Jul 15, 2017 · 3 comments
Labels

Comments

@barrybecker4
Copy link
Member

The problem seems to only be reproducible when run through webstart.
The stack trace is:

WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Exception in thread "Worker Thread" java.lang.StackOverflowError
at scala.collection.immutable.VectorPointer.initFrom$(Vector.scala:690)
at scala.collection.immutable.VectorIterator.initFrom(Vector.scala:586)
at scala.collection.immutable.VectorPointer.initFrom(Vector.scala:688)
at scala.collection.immutable.VectorPointer.initFrom$(Vector.scala:688)
at scala.collection.immutable.VectorIterator.initFrom(Vector.scala:586)
at scala.collection.immutable.Vector.initIterator(Vector.scala:87)
at scala.collection.immutable.Vector.iterator(Vector.scala:94)
at scala.collection.immutable.Vector.iterator(Vector.scala:64)
at scala.collection.IterableLike.foreach(IterableLike.scala:71)
at scala.collection.IterableLike.foreach$(IterableLike.scala:70)
at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:788)
at com.barrybecker4.puzzle.slidingpuzzle.model.SliderBoard.$anonfun$calculateManhattan$1(SliderBoard.scala:95)
at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:156)
at com.barrybecker4.puzzle.slidingpuzzle.model.SliderBoard.calculateManhattan(SliderBoard.scala:94)
at com.barrybecker4.puzzle.slidingpuzzle.model.SliderBoard.(SliderBoard.scala:42)
at com.barrybecker4.puzzle.slidingpuzzle.model.SliderBoard.(SliderBoard.scala:57)
at com.barrybecker4.puzzle.slidingpuzzle.model.SliderBoard.(SliderBoard.scala:68)
at com.barrybecker4.puzzle.slidingpuzzle.model.SliderBoard.doMove(SliderBoard.scala:160)
at com.barrybecker4.puzzle.slidingpuzzle.SlidingPuzzleController.transition(SlidingPuzzleController.scala:41)
at com.barrybecker4.puzzle.slidingpuzzle.SlidingPuzzleController.transition(SlidingPuzzleController.scala:23)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.$anonfun$search$1(SequentialPuzzleSolver.scala:54)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.$anonfun$search$1$adapted(SequentialPuzzleSolver.scala:53)
at scala.collection.mutable.ArraySeq.foreach(ArraySeq.scala:74)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.search(SequentialPuzzleSolver.scala:53)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.$anonfun$search$1(SequentialPuzzleSolver.scala:58)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.$anonfun$search$1$adapted(SequentialPuzzleSolver.scala:53)
at scala.collection.mutable.ArraySeq.foreach(ArraySeq.scala:74)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.search(SequentialPuzzleSolver.scala:53)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.$anonfun$search$1(SequentialPuzzleSolver.scala:58)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.$anonfun$search$1$adapted(SequentialPuzzleSolver.scala:53)
at scala.collection.mutable.ArraySeq.foreach(ArraySeq.scala:74)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.search(SequentialPuzzleSolver.scala:53)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.$anonfun$search$1(SequentialPuzzleSolver.scala:58)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.$anonfun$search$1$adapted(SequentialPuzzleSolver.scala:53)
at scala.collection.mutable.ArraySeq.foreach(ArraySeq.scala:74)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.search(SequentialPuzzleSolver.scala:53)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.$anonfun$search$1(SequentialPuzzleSolver.scala:58)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.$anonfun$search$1$adapted(SequentialPuzzleSolver.scala:53)
at scala.collection.mutable.ArraySeq.foreach(ArraySeq.scala:74)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.search(SequentialPuzzleSolver.scala:53)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.$anonfun$search$1(SequentialPuzzleSolver.scala:58)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.$anonfun$search$1$adapted(SequentialPuzzleSolver.scala:53)
at scala.collection.mutable.ArraySeq.foreach(ArraySeq.scala:74)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.search(SequentialPuzzleSolver.scala:53)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.$anonfun$search$1(SequentialPuzzleSolver.scala:58)

@barrybecker4
Copy link
Member Author

Just happened in IDE too using the 15 tile puzzle

Exception in thread "Worker Thread" java.lang.StackOverflowError
at scala.Array$.ofDim(Array.scala:220)
at com.barrybecker4.puzzle.slidingpuzzle.model.SliderBoard.(SliderBoard.scala:57)
at com.barrybecker4.puzzle.slidingpuzzle.model.SliderBoard.(SliderBoard.scala:68)
at com.barrybecker4.puzzle.slidingpuzzle.model.SliderBoard.doMove(SliderBoard.scala:160)
at com.barrybecker4.puzzle.slidingpuzzle.SlidingPuzzleController.transition(SlidingPuzzleController.scala:41)
at com.barrybecker4.puzzle.slidingpuzzle.SlidingPuzzleController.transition(SlidingPuzzleController.scala:23)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.$anonfun$search$1(SequentialPuzzleSolver.scala:54)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.$anonfun$search$1$adapted(SequentialPuzzleSolver.scala:53)
at scala.collection.mutable.ArraySeq.foreach(ArraySeq.scala:74)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.search(SequentialPuzzleSolver.scala:53)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.$anonfun$search$1(SequentialPuzzleSolver.scala:58)
at com.barrybecker4.puzzle.common.solver.SequentialPuzzleSolver.$anonfun$search$1$adapted(SequentialPuzzleSolver.scala:53)

@barrybecker4
Copy link
Member Author

I can work around the problem in the IDE by passing a bigger value for
-Xss1m like -Xss64m
but the main problem is too many recursive calls.
Seems like it will be necessary to rewrite without recursion.

@barrybecker4
Copy link
Member Author

Not using webstart anymore. Increasing Xss is fine for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant