0.8.8.23:
[sbcl/lichteblau.git] / tests / exhaust.impure.lisp
blobfc432b4f4802549e6b415952becdc0145ddfd900
1 ;;;; tests of the system's ability to catch resource exhaustion problems
3 ;;;; This software is part of the SBCL system. See the README file for
4 ;;;; more information.
5 ;;;;
6 ;;;; While most of SBCL is derived from the CMU CL system, the test
7 ;;;; files (like this one) were written from scratch after the fork
8 ;;;; from CMU CL.
9 ;;;;
10 ;;;; This software is in the public domain and is provided with
11 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
12 ;;;; more information.
14 (cl:in-package :cl-user)
16 ;;; Prior to sbcl-0.7.1.38, doing something like (RECURSE), even in
17 ;;; safe code, would crash the entire Lisp process. Then the soft
18 ;;; stack checking was introduced, which checked (in safe code) for
19 ;;; stack exhaustion at each lambda.
21 ;;; Post 0.7.6.1, this was rewritten to use mprotect()-based stack
22 ;;; protection which does not require lisp code to check anything,
23 ;;; and works at all optimization settings. However, it now signals a
24 ;;; STORAGE-CONDITION instead of an ERROR, so this test needs revising
25 (locally
26 (defun recurse () (recurse) (recurse))
27 (handler-case
28 (recurse)
29 (storage-condition (c) (declare (ignore c)) (quit :unix-status 104))))
31 ;;; oops
32 (quit :unix-status 1)