From: Kevin R. <kp...@ma...> - 2007-06-07 04:28:26
|
I reduced a failure in a program I wrote to this: (funcall (catch 't (block nil (throw 't (lambda () (return)))))) I recognize that this is undefined per CLHS 5.2, but SBCL usually reports a decent error and doesn't corrupt itself for out-of-extent calls to RETURN[-FROM]. In the above case, it does not. On one of my machines: * (funcall (catch 't (block nil (throw 't (lambda () (return)))))) ... Unhandled memory fault at #x0. * (list (lisp-implementation-version) (machine-type) (software-type)) ("1.0.6" "X86" "Darwin") (This was the error I originally hit in my program, and the backtrace did not have any informative frames sufficiently near to the erroneous return-from that I could find out that that was the problem other than by reducing the code. There did not seem to be any corruption; I was able to repeatedly load and test code without restarting that sbcl.) On another machine: * (funcall (catch 't (block nil (throw 't (lambda () (return)))))) fatal error encountered in SBCL pid 10537: fault in heap page 94326 not marked as write-protected boxed_region.first_page: 6231, boxed_region.last_page 6231 LDB monitor ... * (list (lisp-implementation-version) (machine-type) (software-type)) ("1.0.4" "PowerPC" "Darwin") Here are some earlier variations of the test case which also fail poorly on at least one of the above systems: (let (x) (handler-case (block nil (setf x (lambda () (return))) (error "bang")) (error ())) (funcall x)) (let (x) (block t (handler-bind ((error (lambda (c) (return-from t)))) (block nil (setf x (lambda () (return))) (error "bang")))) (funcall x)) (let (x) (catch 't (block nil (setf x (lambda () (return))) (throw 't nil))) (funcall x)) I could not find a failure case which used no SIGNAL or THROW. -- Kevin Reid <http://homepage.mac.com/kpreid/> |