chicken-janitors
[Top][All Lists]
Advanced

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

Re: [Chicken-janitors] #1067: Variable set! in signal handler is optimis


From: Chicken Trac
Subject: Re: [Chicken-janitors] #1067: Variable set! in signal handler is optimised away in other code.
Date: Sun, 15 Dec 2013 16:34:14 -0000

#1067: Variable set! in signal handler is optimised away in other code.
----------------------+-----------------------------------------------------
  Reporter:  andyjpb  |       Owner:       
      Type:  defect   |      Status:  new  
  Priority:  major    |   Milestone:  4.9.0
 Component:  unknown  |     Version:  4.8.x
Resolution:           |    Keywords:       
----------------------+-----------------------------------------------------

Comment(by andyjpb):

 Here's a self contained program that should reproduce the behaviour, but I
 can't currently get it to work.

 {{{
 ; csc -s -O2 -d1 t.scm -j t -o t.so
 ; csc -s t.import.scm -O2 -d0 -o t.import.so
 ; echo "(use t)(handler)" > tl.scm
 ; csc tl.scm
 ; ./tl
 ; killall -TERM tl
 (module t (handler)

 (import chicken scheme)
 (use posix srfi-18)

 (define keep-going #t) ; #t seems to cause the (if keep-going ...) check
 to get optimised away.

 (define (shutdown #!optional signum)
  (printf "Proclaim got signal ~A: shutting down...\n" signum)
  (set! keep-going #f))

 (define (handler)
   (set-signal-handler! signal/term shutdown)

   ;(thread-start!
   ;  (make-thread
   ;    (lambda ()
         (let loop ()
           (printf "Still going...\n")
           (thread-sleep! 1)
           (if keep-going
             (loop)));)))

   ))
 }}}

-- 
Ticket URL: <http://bugs.call-cc.org/ticket/1067#comment:3>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.

reply via email to

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