unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* signal handling different in 1.8.3 than 1.8.1?
@ 2008-06-01 19:35 Gregory Marton
  2008-06-03 15:07 ` Ludovic Courtès
  0 siblings, 1 reply; 26+ messages in thread
From: Gregory Marton @ 2008-06-01 19:35 UTC (permalink / raw)
  To: bug-guile

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~~~~^^^^~~~~~--~~~~~~~~~~~~~~~++~~~~~~~





^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2008-07-18 13:44 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-01 19:35 signal handling different in 1.8.3 than 1.8.1? Gregory Marton
2008-06-03 15:07 ` Ludovic Courtès
2008-06-03 16:05   ` Gregory Marton
2008-06-03 20:32     ` Ludovic Courtès
2008-06-06 19:37       ` Gregory Marton
2008-06-06 19:56         ` Gregory Marton
2008-06-07 10:38           ` Ludovic Courtès
     [not found]             ` <Pine.LNX.4.64.0806260936100.31255@ashmore.csail.mit.edu>
     [not found]               ` <87bq1ngvw7.fsf@gnu.org>
2008-06-27 19:05                 ` Gregory Marton
2008-06-28 18:09                   ` Ludovic Courtès
2008-06-29 17:45                     ` Gregory Marton
2008-06-29 18:02                       ` Gregory Marton
2008-06-29 18:06                         ` Gregory Marton
2008-06-30  7:38                           ` Ludovic Courtès
2008-07-07  0:30                             ` Gregory Marton
2008-07-07  8:57                               ` Ludovic Courtès
2008-07-17 12:08                                 ` Gregory Marton
2008-07-17 12:37                                   ` Ludovic Courtès
2008-07-17 15:24                                     ` Gregory Marton
2008-07-17 15:51                                       ` Ludovic Courtès
2008-07-17 15:59                                         ` Gregory Marton
2008-07-17 20:47                                           ` Neil Jerram
2008-07-17 22:11                                             ` Gregory Marton
2008-07-18  8:18                                               ` Ludovic Courtès
2008-07-18 11:23                                                 ` Gregory Marton
2008-07-18 12:02                                                   ` Ludovic Courtès
2008-07-18 13:44                                                     ` with-timeout and asynchronous alarm (was: signal handling different in 1.8.3 than 1.8.1?) Gregory Marton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).