Subject: [clisp-list] (random tester) Large term causes segfault after compilation

From: "Paul F. Dietz" <[email-masked]>
Date: Tue Nov 4 09:57:08 2003

The gcl random tester came up with the following example.  It segfaulted
during pruning, so I pruned it manually as far as I could.  It's still
very large, and segfaults when called on the indicated arguments.  There's
a lot of apparent fluff in the code whose removal causes the segfault
to disappear.

This was run in CLISP built 3 Nov 2003 (around 4AM CST) from cvs head.

(defparameter *fn*
   '(lambda (a b c)
      (if (not
           (and
            (or (not nil)
                (logbitp 22 (unwind-protect -1)
                         ))
            (or a
                (logbitp 2 (if (ldb-test (byte 31 29)
                                         (if (= 10) -1773 a))
                               -2
                             (if (= -1) -7762 0)
                             )))
            (or
             (zerop (if b c 1))
             (and
              b c
              (typep
               (+
                (floor (setq c -100))
                (max 26 (isqrt
                         (identity
                          (identity
                           (identity
                            (abs (ash a (min 14 (- (round 11065954 (min -35 c))))
                                      ))))))))
               '(integer * 3894))
              (if (or b (= -10) b)
                  (or b a)
                (and (ldb-test (byte 19 27) (if (>= 10) b -2))
                     (typep
                      (let* ((v1 (ldb (byte 1 5) (labels ((%f12 (f12-1 f12-2) 100
                                                                )) 11))))
                        (lognor 15363 (logand (logand 0 b -10)
                                              (* (lognor a (setq a -335))))))
                      '(integer * 7))
                     ))))))
          (let ((v2 (let* ((v1 (lognor (if b -10 b)
                                       (restart-case c)
                                       )))
                      10)))
            (logxor (labels ((%f1 () b)) (%f1))
                    (if (< 0) b 0)
                    (if b 100 0)
                    (if c v2 0)
                    (if (or a (= a))
                        (unwind-protect b)
                      43)
                    (if (or b (not (and (> -3) (if (> 10) b nil))))
                        (if v2 (unwind-protect 100) 0)
                      (if b 1031483 (if a (logior a) 0)))
                    (if c -91597154 0)
                    (if c -83394844 0)
                    ))
        (logorc2 (if c 0 b)
                 (let ((v8 (if (= -101108 b) 0 b)))
                   (if (and (not (and (>= v8 0) (and b nil)))
                            (> v8 b))
                       0
                     (- c (if (< b c)
                              (if (= b c) 0 v8)
                            b))))))))

(defparameter *vals* '(-102 108841188293 -401434342))

(defun try () (apply (compile nil *fn*) *vals*))

;; (try) ==> causes seg fault

	Paul