[MacRuby] #1355: Segfault occurs when invoked a Module#dup within some threads.
MacRuby
ruby-noreply at macosforge.org
Thu Jul 7 09:20:34 PDT 2011
#1355: Segfault occurs when invoked a Module#dup within some threads.
----------------------------------+-----------------------------------------
Reporter: watson1978@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: blocker | Milestone:
Component: MacRuby | Keywords:
----------------------------------+-----------------------------------------
Comment(by watson1978@…):
It looks like it needs exclusive control in RoxorCore::copy_method()
{{{
#!diff
diff --git a/vm.cpp b/vm.cpp
index 5896ca6..542300a 100644
--- a/vm.cpp
+++ b/vm.cpp
@@ -2452,7 +2452,9 @@ RoxorCore::copy_method(Class klass, Method m)
Method m2 = class_getInstanceMethod(klass, sel);
assert(m2 != NULL);
assert(method_getImplementation(m2) ==
method_getImplementation(m));
+ GET_CORE()->lock();
rb_vm_method_node_t *node2 = method_node_get(m2, true);
+ GET_CORE()->unlock();
memcpy(node2, node, sizeof(rb_vm_method_node_t));
}
return true;
}}}
--
Ticket URL: <http://www.macruby.org/trac/ticket/1355#comment:1>
MacRuby <http://macruby.org/>
More information about the macruby-tickets
mailing list