Memory error on Linux when examining certain types of objects
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Invalid
|
Undecided
|
Unassigned |
Bug Description
This is a bug reported on a debian list, but I can't find it on SBCL list.
In summary, the published version is:
=======
(ql:quickload "cl-monad-macros")
(in-package :cl-monad-macros)
(defparameter *foo* ;; capture the object that causes the error when examined/printed
(with-
(run!
in))))
(type-of *foo*) ==> cons
(type-of (second *foo*)) ==> Unhandled memory fault at #x25.
(print (second *foo*)) ==> Unhandled memory fault at #x1D.
(format t "~A" (second *foo*)) ==> #<sb-kernel:
but
(format t "[ ~A ]" (second *foo*)) ==> Error (TYPE-ERROR) during printing: #<TYPE-ERROR {100E731DC3}>
==========
I actually ran into this problem in a web server trying to output a YASON JSON parsing error object, but I can't replicate it as neatly as the original CL-MONAD example.
For me, it failed in SB-KERNEL:
There is no applicable method for the generic function
But I'm fairly sure it's the same underlying bug.
Software Versions:
SBCL: 2.3.1
uname: Linux xxx.edu 3.10.0-
This code is surely not legal. WITH-INPUT- FROM-STRING creates a stream that must not be used after the body form is exited. As it stands the LAMBDA within sees random junk on the stack. INPUT-STREAM instead.
You will have to rewrite it using MAKE-STRING-