bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

signal handling different in 1.8.3 than 1.8.1?


From: Gregory Marton
Subject: signal handling different in 1.8.3 than 1.8.1?
Date: Sun, 1 Jun 2008 15:35:40 -0400 (EDT)

Hi folks,

Now that I've upgraded to 1.8.3 from 1.8.1, some old test cases are failing. In particular:

(define (ensure body-lambda ensuring-lambda)
   (dynamic-wind
       (lambda () #t)
       body-lambda
       ensuring-lambda))

(define (with-sigaction signum handler flags lamb)
     (let ((old-sigaction (sigaction signum)))
       (if flags (sigaction signum handler flags) (sigaction signum handler))
       (ensure
        lamb
        (lambda ()
          (sigaction signum (car old-sigaction) (cdr old-sigaction))))))

;; imagine an appropriate (assert bool message) and (assert-equal a b msg)

(let ((orig (sigaction SIGALRM))
       (sigcalled #f))
    (with-sigaction
     SIGALRM (lambda (sig) (set! sigcalled #t)) #f (lambda () (raise SIGALRM)))
    (assert sigcalled "we set and handled an alarm")) ;; FAILS in 1.8.3
    (assert-equal orig (sigaction SIGALRM) "returned to the original state")
    (let ((outer "nop")
          (inner "nop"))
      (with-sigaction
          SIGALRM (lambda (sig) (set! outer "outer")) #f
          (lambda ()
            (with-sigaction
             SIGALRM (lambda (sig) (set! inner "inner")) #f
             (lambda ()
               (raise SIGALRM)))
            (raise SIGALRM)))
      (and (assert-equal "inner" inner "inner sig got handled") ;; FAILS
           (assert-equal "outer" outer "outer sig got handled")))
    (assert-equal orig (sigaction SIGALRM) "returned to the original state")

All of these passed in 1.8.1. If this is no longer The Recommended Way, how would one go about it?

Many thanks,
Grem

--
------ __@   Gregory A. Marton                http://csail.mit.edu/~gremio/
--- _`\<,_                                                                .
-- (*)/ (*)          Lots of Insidious Silly Parentheses (LISP :-)
~~~~~~~~~~~~~~~~-~~~~~~~~_~~~_~~~~~v~~~~^^^^~~~~~--~~~~~~~~~~~~~~~++~~~~~~~





reply via email to

[Prev in Thread] Current Thread [Next in Thread]