Memory Fault Error on SBCL when given bad JSON
Hey,
Attempting to parse the following incorrect JSON makes SBCL 2.0.8 pause for several seconds, then raise the error "Unhandled memory fault at #x1200000000. [Condition of type SB-SYS:MEMORY-FAULT-ERROR]".
(jsown:parse "{\"foo\": a}")
I tested this on CCL and Clisp as well. In those, I immediately get an error complaining that an index is out of range for ELT.
Here is the culprit:
https://github.com/madnificent/jsown/blob/744c4407bef58dfa876d9da0b5c0205d869e7977/reader.lisp#L3-L4
Either use (sb-ext:restrict-compiler-policy 'safety 1) when compiling jsown or switch to a JSON parser which does not commit atrocities like the above.
The latter is IMO much better, but keep in mind that I have very strong opinions on the subject.