Project

General

Profile

Bug #18464 » 0001-Fix-interpreter-crash-caused-by-RUBY_INTERNAL_EVENT_.patch

kjtsanaktsidis (KJ Tsanaktsidis), 01/08/2022 04:34 AM

View differences:

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
(1-1/3)