more robust backtraces for syscalls on x86
[sbcl.git] / tests / debug.impure.lisp
index 6ffa8d3..ec0719b 100644 (file)
                    (list '(flet not-optimized))
                    (list '(flet test) #'not-optimized))))))
 
+(with-test (:name :interrupted-syscall)
+  (let ((m (sb-thread:make-mutex))
+        (q (sb-thread:make-waitqueue)))
+    (assert (verify-backtrace
+            (lambda ()
+              (sb-thread:with-mutex (m)
+                (handler-bind ((timeout (lambda (c)
+                                          (error "foo"))))
+                  (with-timeout 0.1
+                    (sb-thread:condition-wait q m)))))
+            `((sb-thread:condition-wait ,q ,m))))))
+
 ;;; Division by zero was a common error on PPC. It depended on the
 ;;; return function either being before INTEGER-/-INTEGER in memory,
 ;;; or more than MOST-POSITIVE-FIXNUM bytes ahead. It also depends on
 (defvar *compile-nil-non-tc* (compile nil '(lambda (y) (cons (funcall *compile-nil-error* y) nil))))
 (with-test (:name (:compile nil))
   (assert (verify-backtrace (lambda () (funcall *compile-nil-non-tc* 13))
-                           '(((lambda (x)) 13)
-                             ((lambda (y)) 13)))))
+                            '(((lambda (x)) 13)
+                              ((lambda (y)) 13)))))
 
 (with-test (:name :clos-slot-typecheckfun-named)
   (assert
 
 (with-test (:name (trace :simple))
   (let ((out (with-output-to-string (*trace-output*)
-              (trace trace-this)
-              (assert (eq 'ok (trace-this)))
-              (untrace))))
+               (trace trace-this)
+               (assert (eq 'ok (trace-this)))
+               (untrace))))
     (assert (search "TRACE-THIS" out))
     (assert (search "returned OK" out))))
 
   (test-inifinite-error-protection))
 
 (with-test (:name (infinite-error-protection :thread)
-                 :skipped-on '(not :sb-thread))
+                  :skipped-on '(not :sb-thread))
   (enable-debugger)
   (let ((thread (sb-thread:make-thread #'test-inifinite-error-protection)))
     (loop while (sb-thread:thread-alive-p thread))))