bug-guile
[Top][All Lists]
Advanced

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

Re: signal handling different in 1.8.3 than 1.8.1?


From: Gregory Marton
Subject: Re: signal handling different in 1.8.3 than 1.8.1?
Date: Fri, 6 Jun 2008 15:37:15 -0400 (EDT)

Aha! So (sleep 0) did nothing, but interestingly (sleep 1) did -- but it didn't sleep 1!

So if I write this as
      (let ((sigcalled #f))
        (with-sigaction
        SIGALRM (lambda (sig) (set! sigcalled #t)) #f
        (lambda () (raise SIGALRM) (sleep 1)))
        (assert sigcalled "we set and handled an alarm"))
      (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) (sleep 1)))
             (raise SIGALRM) (sleep 1)))
        (and (assert-equal "inner" inner "inner sig got handled")
            (assert-equal "outer" outer "outer sig got handled")))
      (assert-equal orig (sigaction SIGALRM) "returned to the original state")

then it passes. I thought it should never reach those sleeps -- what's going on? Also, it effectively doesn't reach the sleeps: the program passes the tests very quickly.

Grem

On Tue, 3 Jun 2008, Ludovic Courtès wrote:

The following message is a courtesy copy of an article
that has been posted to gmane.lisp.guile.bugs as well.

Hello,

Gregory Marton <address@hidden> writes:

The following message is a courtesy copy of an article
that has been posted to gmane.lisp.guile.bugs as well.

Is address@hidden now out of date?   I may have to get a
newsreader. Are they mirrored?

No, address@hidden' is not outdated: it's just that I'm posting
through Gmane (http://gmane.org/), which is a mail/news bi-directional
gateway.  The above notice is issued (I think) by Gmane someone is
explicitly Cc'd to a newsgroup post.

Nevertheless, it has consistently passed in 1.8.1 and consistently
fails in 1.8.3 with no other changes.

Sure, but a quick glance at `NEWS' didn't reveal anything obviously
related to the problem at hand.

BTW, you might want to even switch to 1.8.5 while you're at it.

call-with-unblocked-asyncs complains:
    misc-error: asyncs already unblocked

OK, so it's not needed.

With (sleep 0) is no different than without.

I just tried and it depends on where you place it.  For instance, a
`format' call (which also does `SCM_TICK' as a side effect) within the
second lambda passed to `ensure' in `with-sigaction' does the trick.

The key insight here is that signal delivery in Guile is asynchronous,
so you can't know for sure when it will happen.  It'd be nice to be able
to force system asyncs to run, though.

As to why there's such a reproducible difference between 1.8.1 and
1.8.3, maybe you could try using `git-bisect' to find out which change
set between tags `release_1-8-1' and `release_1-8-3' introduced the
change in behavior.  I think it's probably a side-effect of some
unrelated change but again, a valid side-effect.

Hope this helps,
Ludovic.


--
------ __@   Gregory A. Marton                http://csail.mit.edu/~gremio/
--- _`\<,_                                                                .
-- (*)/ (*)                  My religion . . . is kindness.
~~~~~~~~~~~~~~~~-~~~~~~~~_~~~_~~~~~v~~~~^^^^~~~~~--~~~~~~~~~~~~~~~++~~~~~~~

reply via email to

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