3 # This test is as convoluted as it is to avoid having failing tests
4 # hang the test-suite, as the typical failure mode used to be SBCL
5 # hanging uninterruptible in GC.
11 echo //entering finalize.
test.sh
13 # $! is not set correctly when calling run_sbcl, do it directly
14 "$SBCL_RUNTIME" --core "$SBCL_CORE" $SBCL_ARGS <<EOF > /dev/null &
22 (let ((junk (mapcar (compile nil '(lambda (_)
25 (finalize x (lambda ()
27 (setf *tmp* (make-list 10000))
31 (setf junk (foo junk))
36 ;; Stopping the finalizer thread ensures that queued finalizers execute.
37 ;; [I don't think it's possible for it to stop before draining the queue,
38 ;; but that isn't part of the contract with stopping. If this test fails,
39 ;; try inserting a call to RUN-PENDING-FINALIZERS after this line]
40 #+sb-thread (sb-impl::finalizer-thread-stop)
43 (with-open-file (f "finalize-test-passed" :direction :output)
45 (with-open-file (f "finalize-test-failed" :direction :output)
46 (format f "OOPS: ~A~%" *count*)))
54 echo "Waiting for SBCL to finish stress-testing finalizers"
56 if [ -f finalize-test-passed
]; then
58 rm finalize-test-passed
60 elif [ -f finalize-test-failed
]; then
62 rm finalize-test-failed
67 if [ $WAITED = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ]; then
69 echo "timeout, killing SBCL"
71 exit $EXIT_LOSE # Failure, SBCL probably hanging in GC