Bug #18464 » 0001-Fix-interpreter-crash-caused-by-RUBY_INTERNAL_EVENT_.patch
| gc.c | ||
|---|---|---|
|
static void
|
||
|
gc_event_hook_body(rb_execution_context_t *ec, rb_objspace_t *objspace, const rb_event_flag_t event, VALUE data)
|
||
|
{
|
||
|
// if (UNLIKELY(!ec->cfp)) return;
|
||
|
const VALUE *pc = ec->cfp->pc;
|
||
|
if (pc && VM_FRAME_RUBYFRAME_P(ec->cfp)) {
|
||
|
/* increment PC because source line is calculated with PC-1 */
|
||
| test/objspace/test_ractor.rb | ||
|---|---|---|
|
require "test/unit"
|
||
|
require "objspace"
|
||
|
class TestObjSpaceRactor < Test::Unit::TestCase
|
||
|
def test_tracing_does_not_crash
|
||
|
ObjectSpace.trace_object_allocations do
|
||
|
r = Ractor.new do
|
||
|
obj = 'a' * 1024
|
||
|
Ractor.yield obj
|
||
|
end
|
||
|
r.take
|
||
|
r.take
|
||
|
end
|
||
|
end
|
||
|
end
|
||