brandonbloom / fipp

Fast Idiomatic Pretty Printer for Clojure
527 stars 44 forks source link

deeply nested groups overflow the stack #28

Closed bwo closed 5 years ago

bwo commented 9 years ago
user=> (require '[fipp.engine :as e])
nil
user=> (def groups (first (drop 1000 (iterate (fn [x] [:group x]) [:text "hi"]))))
#'user/groups
user=> (e/serialize groups)

StackOverflowError   clojure.lang.Cons.next (Cons.java:39)

owing to the ping-ponging between serialize and serialize-node (so the same thing would presumably also occur for e.g. span.)

brandonbloom commented 9 years ago

Grumble grumble something something about tail calls. Patch welcome.

Sent from my iPhone

On Jun 30, 2015, at 10:58 AM, bwo notifications@github.com wrote:

user=> (require '[fipp.engine :as e]) nil user=> (def groups (first (drop 1000 (iterate (fn [x] [:group x]) [:text "hi"]))))

'user/groups

user=> (e/serialize groups)

StackOverflowError clojure.lang.Cons.next (Cons.java:39) owing to the ping-ponging between serialize and serialize-node (so the same thing would presumably also occur for e.g. span.)

— Reply to this email directly or view it on GitHub.

brandonbloom commented 5 years ago

Closing as I haven't seen this in practice and there is some evidence that related issues have been mitigated with recent versions of Clojure and/or JVM. Please speak up if others are hitting this in real scenarios. Thanks.