CLML throws SB-SYS:MEMORY-FAULT-ERROR in sbcl when trying to make a decision tree with data loaded from a csv file as float or single-float. I've gotten this on both SBCL 1.4.2 under Windows 10 and SBCL 1.4.0-1.el7 under Red Hat Linux 7.4.
The issue is at https://github.com/mmaul/clml/blob/master/decision-tree/src/decision-tree.lisp#L40 since a single-float (or other versions of float) will pass floatp, but then is declared to be type double-float with the safety optimization flag set to 0. This results in a single-float being used as a double-float without any checking and causing an error.
example.lisp:
(defparameter *data* (clml.hjs.read-data:read-data-from-file "iris.csv"
:type :csv
:csv-type-spec '(single-float string)))
(format t "~S~%~%" *data*)
(format t "~S" (clml.decision-tree.decision-tree:make-decision-tree *data* "class"))
CLML throws
SB-SYS:MEMORY-FAULT-ERROR
in sbcl when trying to make a decision tree with data loaded from a csv file asfloat
orsingle-float
. I've gotten this on both SBCL 1.4.2 under Windows 10 and SBCL 1.4.0-1.el7 under Red Hat Linux 7.4.The issue is at https://github.com/mmaul/clml/blob/master/decision-tree/src/decision-tree.lisp#L40 since a
single-float
(or other versions offloat
) will passfloatp
, but then is declared to be typedouble-float
with the safety optimization flag set to 0. This results in a single-float being used as a double-float without any checking and causing an error.example.lisp:
iris.csv:
repl: