chicken-janitors
[Top][All Lists]
Advanced

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

Re: [Chicken-janitors] #723: using set-finalizer in this loop triggers a


From: Chicken Trac
Subject: Re: [Chicken-janitors] #723: using set-finalizer in this loop triggers a OOM panic / segfault
Date: Fri, 11 Nov 2011 08:51:44 -0000

#723: using set-finalizer in this loop triggers a OOM panic / segfault
----------------------+-----------------------------------------------------
  Reporter:  ckeen    |       Owner:  felix
      Type:  defect   |      Status:  new  
  Priority:  major    |   Milestone:  4.8.0
 Component:  unknown  |     Version:  4.7.x
Resolution:           |    Keywords:       
----------------------+-----------------------------------------------------

Comment(by ckeen):

 gah, this is weird...

 {{{
 (use lolevel)

 (define (make-stuff)
   (let ((mem (allocate 1000)))
     (set-finalizer! mem free)
     mem))

 (let lp ((i 0))
   (print i)
   (make-stuff)
   (lp (add1 i)))
 }}}

 either one of these version crashes for me now on OpenBSD 32 bit 4.7.0
 (sorry I don't have a more recent version there)

 The above program does crash with current master on 64 bit linux when
 adding -O3. With the print output sent to /dev/null I get this:

 {{{
  ./bla -:d >/dev/null
 [debug] application startup...
 [debug] heap resized to 500000 bytes
 [debug] stack bottom is 0x7ffff803d090.
 [debug] entering toplevel toplevel...
 [debug] stack resized to 262144 bytes
 [debug] entering toplevel library_toplevel...
 [debug] entering toplevel build_2dversion_toplevel...
 [debug] resizing heap dynamically from 500k to 1032k ...
 [debug] entering toplevel eval_toplevel...
 [debug] entering toplevel expand_toplevel...
 [debug] entering toplevel modules_toplevel...
 [debug] entering toplevel lolevel_toplevel...
 [debug] entering toplevel srfi_2d69_toplevel...
 [debug] resizing heap dynamically from 1032k to 2196k ...
 [panic] out of memory - heap full while resizing - execution terminated

 ...more...
 bla.scm:6: set-finalizer!
 bla.scm:12: lp
 bla.scm:10: print
 bla.scm:11: make-stuff
 bla.scm:5: allocate
 bla.scm:6: set-finalizer!
 bla.scm:12: lp
 bla.scm:10: print
 bla.scm:11: make-stuff
 bla.scm:5: allocate
 bla.scm:6: set-finalizer!
 bla.scm:12: lp
 bla.scm:10: print
 bla.scm:11: make-stuff
 bla.scm:5: allocate
 bla.scm:6: set-finalizer!       <--
 }}}

-- 
Ticket URL: <http://bugs.call-cc.org/ticket/723#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]