Project

General

Profile

ActionsLike0

Bug #8492

closed

ObjectSpace.after_gc_start_hook aborts with GC.stress

Added by naruse (Yui NARUSE) almost 12 years ago. Updated over 11 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 2.1.0dev (2013-06-05 trunk 41080) [x86_64-freebsd9.1]
[ruby-dev:47400]

Description

以下を実行すると assert(during_gc > 0) に失敗して abort します。
ruby -robjspace -e'ObjectSpace.after_gc_start_hook=proc{};GC.stress=true;{}'
gc.c:3818 の
gc_event_hook(objspace, RUBY_INTERNAL_EVENT_GC_START, 0 /* TODO: pass minor/immediate flag? */);
実行後に、during_gc が 0 になっている模様。

Added by nobu (Nobuyoshi Nakada) over 11 years ago

Revision 53861b8a

vm_trace.c: fix infinite hook

  • thread.c (rb_threadptr_execute_interrupts): flush postponed job only
    once at last.
  • vm_trace.c (rb_postponed_job_flush): defer calling postponed jobs
    registered while flushing to get rid of infinite reentrance of
    ObjectSpace.after_gc_start_hook. [ruby-dev:47400] [Bug #8492]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

ActionsLike0

Also available in: Atom PDF