1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
parent 701c70e068
commit 264f490012
2 changed files with 8 additions and 1 deletions

View file

@ -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> Sat May 29 23:30:33 2010 Yusuke Endoh <mame@tsg.ne.jp>
* string.c (str_replace_shared): change embedded state atomically. * string.c (str_replace_shared): change embedded state atomically.

3
gc.c
View file

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