<< Back to previous view

[TRDR-11] Stack overflow on whitespace in reader/read and edn/read Created: 05/Dec/13  Updated: 06/Jun/18  Resolved: 06/Jun/18

Status: Closed
Project: tools.reader
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Paul Bauer Assignee: Nicola Mometto
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File fix_stack_overflow_in_reader.patch    
Patch: Code


reader/read and edn/read call themselves recursively for several encountered character classes - whitespace, comments.
This is high-risk for stack overflow, especially for machine-generated data.

Motivating Use Case: cljs files generated via cljx are particularly prone to trigger tools.reader stack overflow errors. Cljx replaces un-included forms with homomorphic whitespace blocks to preserve line number and column errors on compilation.

Comment by Nicola Mometto [ 05/Dec/13 3:50 PM ]

Fixed: https://github.com/clojure/tools.reader/commit/01b53cb61b586e78cf3f70f12ba2adbbdb7abb25

Thanks, I took the liberty of changing the commit description.

Comment by Paul Bauer [ 05/Dec/13 3:53 PM ]

Thanks for changing the commit message. facepalm
Missed that when I generated the patch

Generated at Fri Oct 19 06:04:14 CDT 2018 using JIRA 4.4#649-r158309.