[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] Scrutiny type for signal-handler wrong
From: |
Mario Domenech Goulart |
Subject: |
Re: [Chicken-hackers] [PATCH] Scrutiny type for signal-handler wrong |
Date: |
Sat, 06 Oct 2012 19:36:56 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux) |
On Sat, 6 Oct 2012 18:28:22 +0200 Peter Bex <address@hidden> wrote:
> I noticed that compiling scsh-process with "standard-extension" caused
> it to consistently segfault. Turns out that the type entry for
> signal-handler is wrong; it is declared to return a procedure always,
> but it may return #f when no handler is installed yet. This causes
> the scrutinizer to eliminate the WHEN check in the following code:
>
> (use posix)
>
> (set-signal-handler!
> signal/chld
> (let ((old-handler (signal-handler signal/chld)))
> (lambda (signal)
> (print "Got " signal ", old-handler is " old-handler)
> (when old-handler (print "Calling old-handler(!)") (old-handler
> signal)))))
>
> (process-fork (lambda () (print "child")))
> (sleep 1)
> (print "parent")
>
> $ csc -O3 test.scm
> [...]
> $ ./test
> child
> Got 20, old-handler is #f
> Calling old-handler(!)
> zsh: segmentation fault ./test
Your patch has been pushed. Thanks, Peter.
Best wishes.
Mario
--
http://parenteses.org/mario