* gc.c (force_chain_object, rb_objspace_call_finalizer): delete

finalizer entry after corresponding finalizer is executed.
  This caused SEGV when test/cgi is executed with GC.stress = true.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2010-05-29 15:10:01 +00:00
Родитель 701c70e068
Коммит 264f490012
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Sun May 30 00:02:39 2010 Yusuke Endoh <mame@tsg.ne.jp>
* gc.c (force_chain_object, rb_objspace_call_finalizer): delete
finalizer entry after corresponding finalizer is executed.
This caused SEGV when test/cgi is executed with GC.stress = true.
Sat May 29 23:30:33 2010 Yusuke Endoh <mame@tsg.ne.jp>
* string.c (str_replace_shared): change embedded state atomically.

3
gc.c
Просмотреть файл

@ -2840,7 +2840,7 @@ force_chain_object(st_data_t key, st_data_t val, st_data_t arg)
curr->table = val;
curr->next = *prev;
*prev = curr;
return ST_DELETE;
return ST_CONTINUE;
}
void
@ -2873,6 +2873,7 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace)
while (list) {
struct force_finalize_list *curr = list;
run_finalizer(objspace, curr->obj, rb_obj_id(curr->obj), curr->table);
st_delete(finalizer_table, (st_data_t*)&curr->obj, 0);
list = curr->next;
xfree(curr);
}