[ruby-cvs:66640] ko1:r59462 (trunk): release VM stack properly.

ko1 at ruby-lang.org ko1 at ruby-lang.org
Wed Aug 2 09:50:42 JST 2017


ko1	2017-08-02 09:50:42 +0900 (Wed, 02 Aug 2017)

  New Revision: 59462

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59462

  Log:
    release VM stack properly.
    
    * cont.c: r55766 change the handling method of Fiber's VM stack.
      Resumed Fiber points NULL as VM stack and running Thread has
      responsibility to manage it (marking and releasing).
    
      However, thread_start_func_2()@thread.c and thread_free()@vm.c
      doesn't free the VM stack if corresponding root Fiber is exist.
      This causes memory leak. [Bug #13772]
    
    * cont.c (root_fiber_alloc): fib->cont.saved_thread.ec.stack should be NULL
      because running thread has responsibility to manage this stack.
    
    * vm.c (rb_thread_recycle_stack_release): assert given stack is not NULL
      (callers should care it).

  Modified files:
    trunk/cont.c
    trunk/thread.c
    trunk/vm.c


More information about the ruby-cvs mailing list