s-webber / projog

Prolog programming for the Java platform.
Apache License 2.0
37 stars 9 forks source link

StackOverflowError thrown by getTerm() for large mutable lists #199

Closed s-webber closed 3 years ago

s-webber commented 3 years ago

StackOverflowError is thrown from List.getTerm for large mutable lists.

Example of how to observe this bug using Prolog:

?- length(X,10000).

Resulting stacktrace:

Caught: java.lang.StackOverflowError from class: org.projog.core.term.List method: getTerm line: 104
java.lang.StackOverflowError
    at org.projog.core.term.List.getTerm(List.java:104)
    at org.projog.core.term.List.getTerm(List.java:1)
    at org.projog.core.term.List.getTerm(List.java:105)
    at org.projog.core.term.List.getTerm(List.java:1)
    at org.projog.core.term.List.getTerm(List.java:105)