From 43e8a7a3ebb77b270de3c54c0c01d681070953ad Mon Sep 17 00:00:00 2001 From: mame Date: Thu, 28 Jul 2011 15:50:00 +0000 Subject: * backport r32669 from trunk. * proc.c (struct METHOD), gc.c (gc_marks), vm_method.c (rb_gc_mark_unlinked_live_method_entries): fix SEGV bug. rb_method_entry_t was free'd even when the method is still on the stack if it is BMETHOD (i.e., Method#call). This is because rb_method_entry_t is embedded in struct METHOD. This commit separates them and marks the live method entries. See [ruby-core:38449] in detail. fix [Bug #5047] [ruby-core:38171] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- gc.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gc.c') diff --git a/gc.c b/gc.c index beb697700e..8c33323e9b 100644 --- a/gc.c +++ b/gc.c @@ -2461,6 +2461,8 @@ gc_marks(rb_objspace_t *objspace) rb_gc_mark_parser(); + rb_gc_mark_unlinked_live_method_entries(th->vm); + /* gc_mark objects whose marking are not completed*/ while (!MARK_STACK_EMPTY) { if (mark_stack_overflow) { -- cgit v1.2.3