(in-package #:cl-user) (defgeneric f (x) (:method (x) (declare (ignore x)) t)) (defclass c () ()) (defun test-method (&key (callers 1)) (let ((i (make-instance 'c)) (stop nil)) (dotimes (i callers) (sb-thread:make-thread (lambda () (loop (ignore-errors ;; Ignore errors as reported in ;; https://bugs.launchpad.net/sbcl/+bug/1758898 (loop (f nil) (when stop (return)))) (when stop (return)))) :name (format nil "Caller"))) (unwind-protect (loop (defmethod f ((x c)) x) (ignore-errors ;; Ignore errors as reported in ;; https://bugs.launchpad.net/sbcl/+bug/1758898 (unless (and (eq (f nil) t) (eq (f i) i)) (format t "~&Transient") (finish-output) (unless (and (eq (f nil) t) (eq (f i) i)) (format t "~&Persistent") (finish-output) (return))))) (setf stop t)) (assert (and (eq (f nil) t) (eq (f i) i))))) #| Bug 2: Persistent errors where the initial dfun is computed based on the information after the specialized method is removed and the result is stored after the method has been added again. |# (test-method :callers 4)