JCSG icon indicating copy to clipboard operation
JCSG copied to clipboard

WeightedTubeSample example causes StackOverflowError

Open PeerHeijnen opened this issue 7 years ago • 1 comments

Hi,

When trying out your bundled examples, the 'WeightedTubeSample' crashes with the following stack trace:

Exception in thread "main" java.lang.StackOverflowError
	at java.util.HashMap.put(HashMap.java:612)
	at java.util.HashSet.add(HashSet.java:220)
	at java.util.stream.DistinctOps$1$2.accept(DistinctOps.java:174)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at eu.mihosoft.jcsg.Node.build(Node.java:244)
	at eu.mihosoft.jcsg.Node.build(Node.java:259)
	at eu.mihosoft.jcsg.Node.build(Node.java:259)
	at eu.mihosoft.jcsg.Node.build(Node.java:259)
	at eu.mihosoft.jcsg.Node.build(Node.java:259)
	at eu.mihosoft.jcsg.Node.build(Node.java:259)
	at eu.mihosoft.jcsg.Node.build(Node.java:259)
	at eu.mihosoft.jcsg.Node.build(Node.java:259)
	at eu.mihosoft.jcsg.Node.build(Node.java:259)
	at eu.mihosoft.jcsg.Node.build(Node.java:259)

Tested against v0.5.7. The RoundedCubeSample works fine.

PeerHeijnen avatar Jul 06 '18 11:07 PeerHeijnen

Can you try with an increased stack? Some samples don't work with default stacksize of the JVM (might also depend on the JVM vendor and version you are using).

miho avatar Oct 27 '18 22:10 miho