* More fixes have been made to treatment of floating point exception
treatment and other Unix signals. In particular, floating point
exceptions no longer cause Bus errors on the SPARC/Linux platform.
+ * The detection and handling of control stack exhaustion (infinite
+ or very deeply nested recursion) has changed. Stack exhaustion
+ detection is now done by write-protecting pages at the OS level
+ and applies at all optimization settings; when found, a
+ SB-KERNEL:CONTROL-STACK_EXHAUSTED condition (subclass of
+ STORAGE-CONDITION) is signalled, so stack exhaustion can no longer
+ be caught using IGNORE-ERRORS
planned incompatible changes in 0.7.x:
* When the profiling interface settles down, maybe in 0.7.x, maybe
(define-condition parse-unknown-type (condition)
((specifier :reader parse-unknown-type-specifier :initarg :specifier)))
+(define-condition control-stack-exhausted (storage-condition)
+ ()
+ (:report
+ (lambda (condition stream)
+ (format stream
+ "Control stack exhausted (no more space for function call frames). This is probably due to heavily nested or infinitely recursive function calls, or a tail call that SBCL cannot or has not optimized away."))))
+
(infinite-error-protect
(format *error-output*
"Control stack guard page temporarily disabled: proceed with caution~%")
- (error "Control stack exhausted (no more space for function call frames). This is probably due to heavily nested or infinitely recursive function calls, or a tail call that SBCL cannot or has not optimized away."))))
+ (error 'control-stack-exhausted))))
+
build_fake_control_stack_frames(context);
/* signal handler will "return" to this error-causing function */
*os_context_pc_addr(context) = function;
-#ifndef LISP_FEATURE_X86
+#ifdef LISP_FEATURE_X86
/* this much of the calling convention is common to all
non-x86 ports */
+ *os_context_register_addr(context,reg_ECX) = 0;
+#else
*os_context_register_addr(context,reg_NARGS) = 0;
*os_context_register_addr(context,reg_LIP) = function;
*os_context_register_addr(context,reg_CFP) =
(cl:in-package :cl-user)
\f
;;; Prior to sbcl-0.7.1.38, doing something like (RECURSE), even in
-;;; safe code, would crash the entire Lisp process. Now it should
-;;; signal an error in a context where the soft stack limit has been
-;;; relaxed enough that the error can be handled.
+;;; safe code, would crash the entire Lisp process. Then the soft
+;;; stack checking was introduced, which checked (in safe code) for
+;;; stack exhaustion at each lambda.
+
+;;; Post 0.7.6.1, this was rewritten to use mprotect()-based stack
+;;; protection which does not require lisp code to check anything,
+;;; and works at all optimization settings. However, it now signals a
+;;; STORAGE-CONDITION instead of an ERROR, so this test needs revising
(locally
- (declare (optimize safety))
(defun recurse () (recurse) (recurse))
- (ignore-errors (recurse)))
+ (handler-case
+ (recurse)
+ (storage-condition (c) (declare (ignore c)) (quit :unix-status 104))))
\f
-;;; success
-(quit :unix-status 104)
+;;; oops
+(quit :unix-status 1)
;;; for internal versions, especially for internal versions off the
;;; main CVS branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.7.6.4"
+"0.7.6.5"