<< Back to previous view

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

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

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

Attachments: Text File fix_stack_overflow_in_reader.patch    
Patch: Code

 Description   

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.



 Comments   
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 Michael Bauer [ 05/Dec/13 3:53 PM ]

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

Generated at Wed Apr 16 14:00:00 CDT 2014 using JIRA 4.4#649-r158309.