[ruby-cvs:66694] nagachika:r59516 (ruby_2_4): merge revision(s) 59462, 59474: [Backport #13772]

nagachika at ruby-lang.org nagachika at ruby-lang.org
Sat Aug 5 15:35:02 JST 2017


nagachika	2017-08-05 15:35:02 +0900 (Sat, 05 Aug 2017)

  New Revision: 59516

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

  Log:
    merge revision(s) 59462,59474: [Backport #13772]
    
    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).
    
    fix stack storing for root fibers.
    
    * cont.c (root_fiber_alloc): this function is called by fiber_current()
      and fiber_store(). fiber_current() should clear VM stack information
      in a fiber data because runnning thread knows stack information and has
      responsibility to manage it. However fiber_store() requires to remain
      VM stack information in a fiber data because the responsibility to manage
      VM stack is moved to the Fiber from the Thread (and switch to another
      fiber).
    
    * cont.c (root_fiber_alloc): save thread's fiber and root_fiber information.

  Modified directories:
    branches/ruby_2_4/
  Modified files:
    branches/ruby_2_4/cont.c
    branches/ruby_2_4/thread.c
    branches/ruby_2_4/vm.c


More information about the ruby-cvs mailing list