Project

General

Profile

Backport #9463

SEGV when calling GC.start in a finalizer

Added by usa (Usaku NAKAMURA) over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
[ruby-dev:47939]

Description

minimum reproduce code:

raise_proc = proc do |id|
  GC.start
end
3.times do
  ObjectSpace.define_finalizer(Object.new, raise_proc)
end

to fix this, need to backport r33361 and r33460.


Related issues

Related to Ruby trunk - Bug #9205: Assertion failed: heap_pages_deferred_final == 0Closed12/03/2013Actions

Associated revisions

Revision 2e574a53
Added by usa (Usaku NAKAMURA) over 5 years ago

merge revision(s) 33361,33460: [Backport #9463]

    * gc.c (slot_sweep, rb_gc_finalize_deferred)
      (rb_objspace_call_finalizer, rb_gc): run finalizers
      sequencially.  [ruby-dev:44562]

    * gc.c (rb_gc_finalize_deferred, rb_objspace_call_finalizer):
      should use ATOMIC_EXCHANGE() to check the previous value.
      [ruby-dev:44596] [Bug #5439]

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

Revision 44762
Added by usa (Usaku NAKAMURA) over 5 years ago

merge revision(s) 33361,33460: [Backport #9463]

* gc.c (slot_sweep, rb_gc_finalize_deferred)
  (rb_objspace_call_finalizer, rb_gc): run finalizers
  sequencially.  [ruby-dev:44562]

* gc.c (rb_gc_finalize_deferred, rb_objspace_call_finalizer):
  should use ATOMIC_EXCHANGE() to check the previous value.
  [ruby-dev:44596] [Bug #5439]

History

Updated by usa (Usaku NAKAMURA) over 5 years ago

  • Related to Bug #9205: Assertion failed: heap_pages_deferred_final == 0 added

Updated by usa (Usaku NAKAMURA) over 5 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

Applied in changeset r44762.


merge revision(s) 33361,33460: [Backport #9463]

* gc.c (slot_sweep, rb_gc_finalize_deferred)
  (rb_objspace_call_finalizer, rb_gc): run finalizers
  sequencially.  [ruby-dev:44562]

* gc.c (rb_gc_finalize_deferred, rb_objspace_call_finalizer):
  should use ATOMIC_EXCHANGE() to check the previous value.
  [ruby-dev:44596] [Bug #5439]

Also available in: Atom PDF