https://bugs.ruby-lang.org/
https://bugs.ruby-lang.org/favicon.ico?1711330511
2021-10-20T14:20:51Z
Ruby Issue Tracking System
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=94193
2021-10-20T14:20:51Z
vo.x (Vit Ondruch)
v.ondruch@tiscali.cz
<ul></ul><p>My guess is that this is not really platform dependent, but instead, this is GC and it exhibits on different platforms just due to different memory layout. I think the issue is that the DTrace probe is trying to access some information which was previously swept by GC. This limits the issue in this simple example it seems:</p>
<pre><code>$ RUBY_GC_HEAP_INIT_SLOTS=100000 ruby -e '[1, 2, 3].push(4)'
</code></pre>
<p>Using two ssh sessions, I have now noticed that there are also quite some messages such as the following reported:</p>
<pre><code>RSTRING_PTR is returning NULL!! SIGSEGV is highly expected to follow immediately. If you could reproduce, attach your debugger here, and look at the passed string.
</code></pre>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=94200
2021-10-20T16:02:05Z
vo.x (Vit Ondruch)
v.ondruch@tiscali.cz
<ul></ul><pre><code>Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7d47ff8 in str_new_frozen_buffer (klass=klass@entry=4295795400, orig=orig@entry=4295625080, copy_encoding=copy_encoding@entry=1) at string.c:1329
1329 else if (STR_EMBEDDABLE_P(RSTRING_LEN(orig), TERM_LEN(orig))) {
(gdb) p (*(struct RString *)(orig))
$1 = {basic = {flags = 73831, klass = 4295795400}, as = {heap = {len = 4295436520, ptr = 0x100072870 "e\bS ", aux = {capa = 0, shared = 0}},
ary = "\350(\a\000\001\000\000\000p(\a\000\001\000\000\000\000\000\000\000\000\000\000"}}
</code></pre>
<p>Not sure this is helpful ...</p>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=94234
2021-10-21T13:54:40Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul></ul><p>vo.x (Vit Ondruch) wrote in <a href="#note-2">#note-2</a>:</p>
<blockquote>
<pre><code>Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7d47ff8 in str_new_frozen_buffer (klass=klass@entry=4295795400, orig=orig@entry=4295625080, copy_encoding=copy_encoding@entry=1) at string.c:1329
1329 else if (STR_EMBEDDABLE_P(RSTRING_LEN(orig), TERM_LEN(orig))) {
(gdb) p (*(struct RString *)(orig))
$1 = {basic = {flags = 73831, klass = 4295795400}, as = {heap = {len = 4295436520, ptr = 0x100072870 "e\bS ", aux = {capa = 0, shared = 0}},
ary = "\350(\a\000\001\000\000\000p(\a\000\001\000\000\000\000\000\000\000\000\000\000"}}
</code></pre>
<p>Not sure this is helpful ...</p>
</blockquote>
<p>The <code>flags</code> 73831 = 0x12067, that means <code>orig</code> is an <code>Array</code> object, which has two elements(0x00000001000728e8, 0x0000000100072870).</p>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=94235
2021-10-21T13:57:09Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul></ul><p>I think a condition of "RSTRING_PTR is returning NULL!!" was fixed this year, but can't remember now.</p>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=94836
2021-11-23T17:35:59Z
vo.x (Vit Ondruch)
v.ondruch@tiscali.cz
<ul></ul><p>nobu (Nobuyoshi Nakada) wrote in <a href="#note-3">#note-3</a>:</p>
<blockquote>
<p>vo.x (Vit Ondruch) wrote in <a href="#note-2">#note-2</a>:</p>
<blockquote>
<pre><code>Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7d47ff8 in str_new_frozen_buffer (klass=klass@entry=4295795400, orig=orig@entry=4295625080, copy_encoding=copy_encoding@entry=1) at string.c:1329
1329 else if (STR_EMBEDDABLE_P(RSTRING_LEN(orig), TERM_LEN(orig))) {
(gdb) p (*(struct RString *)(orig))
$1 = {basic = {flags = 73831, klass = 4295795400}, as = {heap = {len = 4295436520, ptr = 0x100072870 "e\bS ", aux = {capa = 0, shared = 0}},
ary = "\350(\a\000\001\000\000\000p(\a\000\001\000\000\000\000\000\000\000\000\000\000"}}
</code></pre>
<p>Not sure this is helpful ...</p>
</blockquote>
<p>The <code>flags</code> 73831 = 0x12067, that means <code>orig</code> is an <code>Array</code> object, which has two elements(0x00000001000728e8, 0x0000000100072870).</p>
</blockquote>
<p>If that was array, then this is the output:</p>
<pre><code>(gdb) p (*(struct RArray *)(orig))
$3 = {basic = {flags = 73831, klass = 4295795400}, as = {heap = {len = 4295436520, aux = {capa = 4295436400, shared_root = 4295436400}, ptr = 0x0}, ary = {4295436520, 4295436400, 0}}}
(gdb) call ruby_debug_print_v(orig)
DBG> : 0x00000001000a0978 [3LM ] T_ARRAY (Array)[E ] len: 2 (embed)
(gdb) call ruby_debug_print_v((*(struct RArray *)(orig))->as->ary[0])
DBG> : 0x00000001000728e8 [3LM ] T_STRING (String)Ruby
(gdb) call ruby_debug_print_v((*(struct RArray *)(orig))->as->ary[1])
DBG> : 0x0000000100072870 [3LM ] T_STRING (String)BSD-2-Clause
</code></pre>
<p>But why it should be array on such place? Isn't it the crux of the problem? Can <code>rb_tmp_class_path</code> <a href="https://github.com/ruby/ruby/blob/0db68f023372b634603c74fca94588b457be084c/variable.c#L172" class="external">1</a> return array?</p>
<p>Just FTR, there is this RHEL8 ticket <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1986206" class="external">2</a> and it seems there is certainly something fishy with the SystemTap/DTrace probes, because they can report some random strings.</p>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=94838
2021-11-23T18:09:17Z
vo.x (Vit Ondruch)
v.ondruch@tiscali.cz
<ul></ul><p>Interestingly, the error exhibits on two palces as far as I can tell:</p>
<p><a href="https://github.com/ruby/ruby/blob/v3_0_2/lib/rubygems/errors.rb#L181" class="external">https://github.com/ruby/ruby/blob/v3_0_2/lib/rubygems/errors.rb#L181</a><br>
<a href="https://github.com/ruby/ruby/blob/0db68f023372b634603c74fca94588b457be084c/ext/monitor/lib/monitor.rb#L165" class="external">https://github.com/ruby/ruby/blob/0db68f023372b634603c74fca94588b457be084c/ext/monitor/lib/monitor.rb#L165</a></p>
<p>The error.rb corresponds with the original report, while the other place is monitor.rb. What is interesting is that both places try to setup aliases.</p>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=94841
2021-11-23T20:03:47Z
vo.x (Vit Ondruch)
v.ondruch@tiscali.cz
<ul></ul><p>So the array comes via this path:</p>
<p><a href="https://github.com/ruby/ruby/blob/0db68f023372b634603c74fca94588b457be084c/variable.c#L172" class="external">https://github.com/ruby/ruby/blob/0db68f023372b634603c74fca94588b457be084c/variable.c#L172</a><br>
<a href="https://github.com/ruby/ruby/blob/0db68f023372b634603c74fca94588b457be084c/variable.c#L148" class="external">https://github.com/ruby/ruby/blob/0db68f023372b634603c74fca94588b457be084c/variable.c#L148</a><br>
<a href="https://github.com/ruby/ruby/blob/0db68f023372b634603c74fca94588b457be084c/variable.c#L102" class="external">https://github.com/ruby/ruby/blob/0db68f023372b634603c74fca94588b457be084c/variable.c#L102</a></p>
<p>And these are the variables:</p>
<pre><code>(gdb) call ruby_debug_print_v(klass)
DBG> : 0x00000001000a09c8 [3LM ] T_ICLASS
(gdb) call ruby_debug_print_v(n)
DBG> : 0x00000001000a0978 [3LM ] T_ARRAY (Array)[E ] len: 2 (embed)
</code></pre>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=94884
2021-11-24T13:59:37Z
vo.x (Vit Ondruch)
v.ondruch@tiscali.cz
<ul></ul><p>This is the status right before the hook is called:</p>
<pre><code>#0 vm_call_cfunc_with_frame (ec=0x100031cf0, reg_cfp=0x7ffff75afe18, calling=0x7fffffffa790) at vm_insnhelper.c:2916
2916 RUBY_DTRACE_CMETHOD_ENTRY_HOOK(ec, me->owner, me->def->original_id);
(gdb) call ruby_debug_print_v(me)
DBG> : 0x00000001000a0928 [3LM ] T_IMEMO <ment> :core#set_method_alias (pub,cc) type:cfunc alias:0 owner:0x00000001000a0950 defined_class:0x00000001000a0950
(gdb) call ruby_debug_print_v(me->owner)
DBG> : 0x00000001000a0950 [3LM ] T_CLASS (annon)
</code></pre>
<p>And here the <code>klass</code> changes:</p>
<pre><code>#0 rb_dtrace_setup (ec=<optimized out>, klass=4295625040, id=159, args=0x7fffffffa678) at vm.c:444
444 klass = rb_attr_get(klass, id__attached__);
(gdb) l
439 }
440 if (RB_TYPE_P(klass, T_ICLASS)) {
441 klass = RBASIC(klass)->klass;
442 }
443 else if (FL_TEST(klass, FL_SINGLETON)) {
444 klass = rb_attr_get(klass, id__attached__);
445 if (NIL_P(klass)) return FALSE;
446 }
447 type = BUILTIN_TYPE(klass);
448 if (type == T_CLASS || type == T_ICLASS || type == T_MODULE) {
(gdb) n
445 if (NIL_P(klass)) return FALSE;
(gdb) call ruby_debug_print_v(klass)
DBG> : 0x00000001000a09c8 [3LM ] T_ICLASS
</code></pre>
<p>I am not sure I understand what the <code>rb_attr_get(klass, id__attached__)</code> actually does. Originally <a href="https://github.com/ruby/ruby/commit/afb02bbe92e55f877d50ed8705c95a41d541458d" class="external">1</a>, there used to be used just <code>rb_class2name</code> which would work for this case:</p>
<pre><code>(gdb) call rb_class2name(klass)
$44 = 0x1000f28f0 "BasicObject"
</code></pre>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=96386
2022-02-04T13:26:00Z
vo.x (Vit Ondruch)
v.ondruch@tiscali.cz
<ul><li><strong>Subject</strong> changed from <i>SystemTap/DTrace coredump on ppc64le/s390x</i> to <i>SystemTap/DTrace coredump</i></li><li><strong>ruby -v</strong> changed from <i>ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [powerpc64le-linux]</i> to <i>ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-linux]</i></li></ul><p>It is actually reproducible everywhere. I was able to reproduce it on x86_64 although it fails less frequently.</p>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=96388
2022-02-04T17:54:34Z
vo.x (Vit Ondruch)
v.ondruch@tiscali.cz
<ul></ul><p>So the TracePoint API must use similar paths. Therefore, looking at vm_trace.c, I have noticed this <a href="https://github.com/ruby/ruby/blob/46f6575157d4c2f6bbd5693896e26a65037e5552/vm_trace.c#L411" class="external">1</a> line:</p>
<pre><code>trace_arg->self != rb_mRubyVMFrozenCore /* skip special methods. TODO: remove it. */) {
</code></pre>
<p>I have traced their origin to this <a href="https://github.com/ruby/ruby/commit/1be7c799e6ed39f7ac41906c05db149e8c391add" class="external">2</a> commit, but unfortunately, it does not provide any answer. What does it protect against? I am asking, because <code>RubyVM::FrozenCore</code> was mentioned in this <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1986206#c8" class="external">3</a> SystemTap comment and I don't see check like this in the <code>rb_dtrace_setup</code> (while there are certainly quite some checks).</p>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=96429
2022-02-08T19:21:37Z
vo.x (Vit Ondruch)
v.ondruch@tiscali.cz
<ul></ul><p>I have confirmed that the <code>rb_mRubyVMFrozenCore</code> is the problematic class. It seems it gets corrupted during GC cycle. If lucky, their cached <code>classpath</code> is still String, which is ... well, String. But sometimes, it is e.g. Array instead and that is kind of problematic for <code>rb_str_dup</code> to duplicate.</p>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=96439
2022-02-09T10:53:07Z
vo.x (Vit Ondruch)
v.ondruch@tiscali.cz
<ul></ul><p>Some snippets from my debugging. Initially, I set the breakpoint to the place where the rb_mRubyVMFrozenCore is assigned:</p>
<pre><code>(gdb) b vm.c:3388
No source file named vm.c.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (vm.c:3388) pending.
(gdb) r
Starting program: /usr/bin/ruby -e ''
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Breakpoint 1, Init_VM () at vm.c:3388
3388 rb_mRubyVMFrozenCore = fcore;
Missing separate debuginfos, use: dnf debuginfo-install glibc-2.34-21.el9.ppc64le gmp-6.2.0-10.el9.ppc64le libxcrypt-4.4.18-3.el9.ppc64le zlib-1.2.11-31.el9.ppc64le
(gdb) n
3394 mjit = rb_define_module_under(rb_cRubyVM, "MJIT");
</code></pre>
<p>Just for illustration, this is associated SystemTap output which confirms it happens quite early:</p>
<pre><code>69244 obj.create Object :0
69244 obj.create fatal :0
69244 obj.create fatal :0
69244 obj.create Object :0
69244 obj.create ARGF.class :0
69244 obj.create SystemStackError :0
69244 obj.create NoMemoryError :0
</code></pre>
<p>Lets try to collect some information:</p>
<pre><code>(gdb) call ruby_debug_print_v(rb_mRubyVMFrozenCore)
DBG> : 0x00000001000a09c8 [0 ] T_ICLASS
(gdb) p *(*(struct RClass *)(rb_mRubyVMFrozenCore))->ptr.iv_tbl.entries
$1 = {hash = 30421, key = 3809, record = 4295625080}
(gdb) call ruby_debug_print_v(4295625080)
DBG> : 0x00000001000a0978 [0 ] T_STRING (String)RubyVM::FrozenCore
(gdb) p *(struct RString *)(4295625080)
$2 = {basic = {flags = 8685573, klass = 4295927560}, as = {heap = {len = 4195751036648060242, ptr = 0x6f436e657a6f7246 <error: Cannot access memory at address 0x6f436e657a6f7246>, aux = {capa = 25970,
shared = 25970}}, ary = "RubyVM::FrozenCore\000\000\000\000\000"}}
</code></pre>
<p>The <code>*(*(struct RClass *)(rb_mRubyVMFrozenCore))->ptr.iv_tbl.entries</code> seems to link to a <code>RubyVM::FrozenCore</code> string which seem to be reasonable. In ideal state, these values should be static, during the whole Ruby instance lifetime, right? But I suspect they change somehow, so lets try to setup some watch:</p>
<pre><code>(gdb) watch ((struct RBasic *)(4295625080))->klass
Watchpoint 2: ((struct RBasic *)(4295625080))->klass
(gdb) c
Continuing.
</code></pre>
<p>And indeed, the breakpoint is triggered:</p>
<pre><code>Old value = 4295927560
New value = 4295624320
heap_page_add_freeobj (obj=4295625080, page=0x100036d40, objspace=<optimized out>) at gc.c:1701
1701 page->freelist = p;
(gdb) bt
#0 heap_page_add_freeobj (obj=4295625080, page=0x100036d40, objspace=<optimized out>) at gc.c:1701
#1 gc_page_sweep (sweep_page=0x100036d40, heap=0x100031658, objspace=<optimized out>) at gc.c:4923
#2 gc_sweep_step (objspace=objspace@entry=0x100031630, heap=heap@entry=0x100031658) at gc.c:5134
#3 0x00007ffff7bed128 in gc_sweep_continue (heap=<optimized out>, objspace=0x100031630) at gc.c:5202
#4 heap_prepare (heap=<optimized out>, objspace=0x100031630) at gc.c:2041
#5 heap_next_freepage (heap=<optimized out>, objspace=<optimized out>) at gc.c:2200
#6 ractor_cache_slots (cr=<optimized out>, objspace=<optimized out>) at gc.c:2219
#7 newobj_slowpath (wb_protected=1, cr=0x1000357f0, objspace=0x100031630, flags=53274, klass=0) at gc.c:2265
#8 newobj_slowpath_wb_protected (klass=klass@entry=0, flags=flags@entry=53274, objspace=0x100031630, cr=0x1000357f0) at gc.c:2284
#9 0x00007ffff7bed784 in newobj_of0 (cr=<optimized out>, wb_protected=1, flags=53274, klass=0) at gc.c:2322
#10 newobj_of (wb_protected=1, v3=0, v2=0, v1=0, flags=53274, klass=0) at gc.c:2333
#11 rb_imemo_new (type=<optimized out>, v1=0, v2=0, v3=0, v0=0) at gc.c:2418
#12 0x00007ffff7dce0cc in vm_ic_update (reg_ep=<optimized out>, val=<optimized out>, ic=<optimized out>, iseq=<optimized out>) at vm_insnhelper.c:4669
#13 vm_exec_core (ec=0x100031cf0, initial=<optimized out>, initial@entry=0) at insns.def:1043
#14 0x00007ffff7dd1710 in rb_vm_exec (ec=0x100031cf0, mjit_enable_p=<optimized out>) at vm.c:2172
#15 0x00007ffff7dd29f4 in rb_iseq_eval (iseq=0x10004a410) at vm.c:2409
#16 0x00007ffff7c2ce68 in load_iseq_eval (fname=4295431320, ec=0x100031cf0) at load.c:594
#17 require_internal (ec=ec@entry=0x100031cf0, fname=<optimized out>, fname@entry=4295211000, exception=exception@entry=1) at load.c:1065
#18 0x00007ffff7c2e7f4 in rb_require_string (fname=4295211000) at load.c:1142
#19 0x00007ffff7c2e88c in rb_f_require (obj=<optimized out>, fname=<optimized out>) at load.c:838
#20 0x00007ffff7daf538 in ractor_safe_call_cfunc_1 (recv=<optimized out>, argc=<optimized out>, argv=<optimized out>, func=<optimized out>) at vm_insnhelper.c:2750
#21 0x00007ffff7dc4900 in vm_call_cfunc_with_frame (ec=0x100031cf0, reg_cfp=0x7ffff75aff30, calling=<optimized out>) at vm_insnhelper.c:2926
#22 0x00007ffff7dc7644 in vm_sendish (ec=0x100031cf0, reg_cfp=0x7ffff75aff30, cd=0x100121e10, block_handler=<optimized out>, method_explorer=<optimized out>) at vm_callinfo.h:336
#23 0x00007ffff7dcba5c in vm_exec_core (ec=0x100031cf0, initial=<optimized out>, initial@entry=0) at insns.def:789
#24 0x00007ffff7dd1710 in rb_vm_exec (ec=0x100031cf0, mjit_enable_p=<optimized out>) at vm.c:2172
#25 0x00007ffff7dd29f4 in rb_iseq_eval (iseq=0x10003b988) at vm.c:2409
#26 0x00007ffff7c2ce68 in load_iseq_eval (fname=4295394400, ec=0x100031cf0) at load.c:594
#27 require_internal (ec=ec@entry=0x100031cf0, fname=<optimized out>, fname@entry=4295394680, exception=exception@entry=1) at load.c:1065
#28 0x00007ffff7c2e7f4 in rb_require_string (fname=4295394680) at load.c:1142
#29 0x00007ffff7c2e88c in rb_f_require (obj=<optimized out>, fname=<optimized out>) at load.c:838
#30 0x00007ffff7daf538 in ractor_safe_call_cfunc_1 (recv=<optimized out>, argc=<optimized out>, argv=<optimized out>, func=<optimized out>) at vm_insnhelper.c:2750
#31 0x00007ffff7dc4900 in vm_call_cfunc_with_frame (ec=0x100031cf0, reg_cfp=0x7ffff75affa0, calling=<optimized out>) at vm_insnhelper.c:2926
#32 0x00007ffff7dc7644 in vm_sendish (ec=0x100031cf0, reg_cfp=0x7ffff75affa0, cd=0x100190580, block_handler=<optimized out>, method_explorer=<optimized out>) at vm_callinfo.h:336
#33 0x00007ffff7dcba5c in vm_exec_core (ec=0x100031cf0, initial=<optimized out>, initial@entry=0) at insns.def:789
#34 0x00007ffff7dd1710 in rb_vm_exec (ec=0x100031cf0, mjit_enable_p=<optimized out>) at vm.c:2172
#35 0x00007ffff7dd29f4 in rb_iseq_eval (iseq=0x1000689d8) at vm.c:2409
#36 0x00007ffff7df5f60 in rb_load_with_builtin_functions (feature_name=0x7ffff7e961c0 "gem_prelude", table=0x0) at builtin.c:54
#37 0x00007ffff7d2826c in ruby_init_prelude () at ruby.c:1498
#38 ruby_opt_init (opt=0x7fffffffe5a0) at ruby.c:1521
#39 ruby_opt_init (opt=0x7fffffffe5a0) at ruby.c:1506
#40 0x00007ffff7d299d8 in process_options (argc=0, argc@entry=3, argv=0x7fffffffee20, argv@entry=0x7fffffffee08, opt=opt@entry=0x7fffffffe5a0) at ruby.c:1951
#41 0x00007ffff7d2a778 in ruby_process_options (argc=<optimized out>, argv=0x7fffffffee08) at ruby.c:230
#42 0x00007ffff7bc5904 in ruby_options (argc=<optimized out>, argv=0x7fffffffee08) at eval.c:138
#43 0x0000000100000a60 in main (argc=<optimized out>, argv=<optimized out>) at ./main.c:50
</code></pre>
<p>And here is the associated SystemTap log to give rough overview when this happened:</p>
<pre><code>69244 obj.create Object <main>:0
69244 -> Class::inherited <main>:0
69244 <- Class::inherited <main>:0
69244 -> Class::inherited <main>:0
69244 <- Class::inherited <main>:0
69244 -> Class::inherited <main>:0
69244 <- Class::inherited <main>:0
69244 obj.create IOError <main>:0
69244 -> Exception::initialize <main>:0
69244 <- Exception::initialize <main>:0
69244 -> Class::inherited <main>:0
69244 <- Class::inherited <main>:0
69244 obj.create ThreadGroup <main>:0
69244 -> Class::inherited <main>:0
69244 <- Class::inherited <main>:0
69244 -> Class::inherited <main>:0
69244 <- Class::inherited <main>:0
69244 -> Class::inherited <main>:0
69244 <- Class::inherited <main>:0
69244 -> Class::inherited <main>:0
69244 <- Class::inherited <main>:0
69244 -> Class::inherited <main>:0
69244 <- Class::inherited <main>:0
69244 -> Class::inherited <main>:0
69244 <- Class::inherited <main>:0
69244 -> Class::inherited <main>:0
69244 <- Class::inherited <main>:0
69244 -> Class::inherited <main>:0
69244 <- Class::inherited <main>:0
69244 -> Class::inherited <main>:0
69244 <- Class::inherited <main>:0
69244 -> Class::inherited <main>:0
69244 <- Class::inherited <main>:0
69244 -> Class::inherited <main>:0
69244 <- Class::inherited <main>:0
69244 -> Class::inherited <main>:0
69244 <- Class::inherited <main>:0
69244 -> Class::inherited <main>:0
69244 <- Class::inherited <main>:0
69244 -> Class::inherited <main>:0
69244 <- Class::inherited <main>:0
69244 -> Class::inherited <main>:0
69244 <- Class::inherited <main>:0
69244 -> Class::inherited ruby:0
69244 <- Class::inherited ruby:0
69244 -> Class::inherited ruby:0
69244 <- Class::inherited ruby:0
69244 -> BasicObject::singleton_method_added <internal:gc>:33
69244 <- BasicObject::singleton_method_added <internal:gc>:33
69244 -> Module::method_added <internal:gc>:37
69244 <- Module::method_added <internal:gc>:37
69244 -> BasicObject::singleton_method_added <internal:gc>:46
69244 <- BasicObject::singleton_method_added <internal:gc>:46
69244 -> BasicObject::singleton_method_added <internal:gc>:58
69244 <- BasicObject::singleton_method_added <internal:gc>:58
69244 -> BasicObject::singleton_method_added <internal:gc>:72
69244 <- BasicObject::singleton_method_added <internal:gc>:72
69244 -> BasicObject::singleton_method_added <internal:gc>:84
69244 <- BasicObject::singleton_method_added <internal:gc>:84
69244 -> BasicObject::singleton_method_added <internal:gc>:92
69244 <- BasicObject::singleton_method_added <internal:gc>:92
69244 -> BasicObject::singleton_method_added <internal:gc>:110
69244 <- BasicObject::singleton_method_added <internal:gc>:110
69244 -> BasicObject::singleton_method_added <internal:gc>:120
69244 <- BasicObject::singleton_method_added <internal:gc>:120
69244 -> BasicObject::singleton_method_added <internal:gc>:169
69244 <- BasicObject::singleton_method_added <internal:gc>:169
69244 -> BasicObject::singleton_method_added <internal:gc>:183
69244 <- BasicObject::singleton_method_added <internal:gc>:183
69244 -> BasicObject::singleton_method_added <internal:gc>:197
69244 <- BasicObject::singleton_method_added <internal:gc>:197
69244 -> BasicObject::singleton_method_added <internal:gc>:212
69244 <- BasicObject::singleton_method_added <internal:gc>:212
69244 -> BasicObject::singleton_method_added <internal:gc>:230
69244 <- BasicObject::singleton_method_added <internal:gc>:230
69244 -> Module::method_added <internal:gc>:236
69244 <- Module::method_added <internal:gc>:236
69244 -> Module::module_function <internal:gc>:240
69244 -> BasicObject::singleton_method_added <internal:gc>:240
69244 <- BasicObject::singleton_method_added <internal:gc>:240
69244 <- Module::module_function <internal:gc>:240
69244 -> BasicObject::singleton_method_added <internal:ractor>:262
69244 <- BasicObject::singleton_method_added <internal:ractor>:262
69244 -> BasicObject::singleton_method_added <internal:ractor>:273
69244 <- BasicObject::singleton_method_added <internal:ractor>:273
69244 -> BasicObject::singleton_method_added <internal:ractor>:287
69244 <- BasicObject::singleton_method_added <internal:ractor>:287
69244 -> BasicObject::singleton_method_added <internal:ractor>:342
69244 <- BasicObject::singleton_method_added <internal:ractor>:342
69244 -> BasicObject::singleton_method_added <internal:ractor>:415
69244 <- BasicObject::singleton_method_added <internal:ractor>:415
69244 -> RubyVM::FrozenCore::core#set_method_alias <internal:ractor>:422
69244 -> BasicObject::singleton_method_added <internal:ractor>:422
69244 <- BasicObject::singleton_method_added <internal:ractor>:422
69244 <- RubyVM::FrozenCore::core#set_method_alias <internal:ractor>:422
69244 -> Module::method_added <internal:ractor>:426
69244 <- Module::method_added <internal:ractor>:426
69244 -> Module::private <internal:ractor>:426
69244 <- Module::private <internal:ractor>:426
69244 -> RubyVM::FrozenCore::core#set_method_alias <internal:ractor>:431
69244 -> Module::method_added <internal:ractor>:431
69244 <- Module::method_added <internal:ractor>:431
69244 <- RubyVM::FrozenCore::core#set_method_alias <internal:ractor>:431
69244 -> BasicObject::singleton_method_added <internal:ractor>:493
69244 <- BasicObject::singleton_method_added <internal:ractor>:493
69244 -> Module::method_added <internal:ractor>:497
69244 <- Module::method_added <internal:ractor>:497
69244 -> Module::private <internal:ractor>:497
69244 <- Module::private <internal:ractor>:497
69244 -> Module::method_added <internal:ractor>:582
69244 <- Module::method_added <internal:ractor>:582
69244 -> RubyVM::FrozenCore::core#set_method_alias <internal:ractor>:587
69244 -> Module::method_added <internal:ractor>:587
69244 <- Module::method_added <internal:ractor>:587
69244 <- RubyVM::FrozenCore::core#set_method_alias <internal:ractor>:587
69244 -> BasicObject::singleton_method_added <internal:ractor>:626
69244 <- BasicObject::singleton_method_added <internal:ractor>:626
69244 -> Module::method_added <internal:ractor>:693
69244 <- Module::method_added <internal:ractor>:693
69244 -> Module::method_added <internal:ractor>:699
69244 <- Module::method_added <internal:ractor>:699
69244 -> RubyVM::FrozenCore::core#set_method_alias <internal:ractor>:709
69244 -> Module::method_added <internal:ractor>:709
69244 <- Module::method_added <internal:ractor>:709
69244 <- RubyVM::FrozenCore::core#set_method_alias <internal:ractor>:709
69244 -> Module::method_added <internal:ractor>:712
69244 <- Module::method_added <internal:ractor>:712
69244 -> Module::attr_reader <internal:ractor>:717
69244 -> Module::method_added <internal:ractor>:717
69244 <- Module::method_added <internal:ractor>:717
69244 <- Module::attr_reader <internal:ractor>:717
69244 -> Module::method_added <internal:ractor>:733
69244 <- Module::method_added <internal:ractor>:733
69244 -> Module::method_added <internal:ractor>:752
69244 <- Module::method_added <internal:ractor>:752
69244 -> BasicObject::singleton_method_added <internal:ractor>:769
69244 <- BasicObject::singleton_method_added <internal:ractor>:769
69244 -> BasicObject::singleton_method_added <internal:ractor>:810
69244 <- BasicObject::singleton_method_added <internal:ractor>:810
69244 -> Module::method_added <internal:ractor>:823
69244 <- Module::method_added <internal:ractor>:823
69244 -> Module::method_added <internal:ractor>:828
69244 <- Module::method_added <internal:ractor>:828
69244 -> BasicObject::singleton_method_added <internal:ractor>:833
69244 <- BasicObject::singleton_method_added <internal:ractor>:833
69244 -> Module::method_added <internal:integer>:6
69244 <- Module::method_added <internal:integer>:6
69244 -> Module::method_added <internal:integer>:22
69244 <- Module::method_added <internal:integer>:22
69244 -> Module::method_added <internal:integer>:27
69244 <- Module::method_added <internal:integer>:27
69244 -> Module::method_added <internal:integer>:73
69244 <- Module::method_added <internal:integer>:73
69244 -> Module::method_added <internal:integer>:82
69244 <- Module::method_added <internal:integer>:82
69244 -> Module::method_added <internal:integer>:91
69244 <- Module::method_added <internal:integer>:91
69244 -> Module::method_added <internal:integer>:95
69244 <- Module::method_added <internal:integer>:95
69244 -> Module::method_added <internal:integer>:104
69244 <- Module::method_added <internal:integer>:104
69244 -> Module::method_added <internal:integer>:120
69244 <- Module::method_added <internal:integer>:120
69244 -> Module::method_added <internal:integer>:130
69244 <- Module::method_added <internal:integer>:130
69244 -> Module::method_added <internal:integer>:138
69244 <- Module::method_added <internal:integer>:138
69244 -> Module::method_added <internal:integer>:146
69244 <- Module::method_added <internal:integer>:146
69244 -> Module::method_added <internal:io>:62
69244 <- Module::method_added <internal:io>:62
69244 -> Module::method_added <internal:io>:120
69244 <- Module::method_added <internal:io>:120
69244 -> BasicObject::singleton_method_added <internal:dir>:14
69244 <- BasicObject::singleton_method_added <internal:dir>:14
69244 -> Module::method_added <internal:dir>:34
69244 <- Module::method_added <internal:dir>:34
69244 -> BasicObject::singleton_method_added <internal:dir>:42
69244 <- BasicObject::singleton_method_added <internal:dir>:42
69244 -> BasicObject::singleton_method_added <internal:dir>:133
69244 <- BasicObject::singleton_method_added <internal:dir>:133
69244 -> BasicObject::singleton_method_added <internal:ast>:34
69244 <- BasicObject::singleton_method_added <internal:ast>:34
69244 -> BasicObject::singleton_method_added <internal:ast>:49
69244 <- BasicObject::singleton_method_added <internal:ast>:49
69244 -> BasicObject::singleton_method_added <internal:ast>:68
69244 <- BasicObject::singleton_method_added <internal:ast>:68
69244 -> Module::method_added <internal:ast>:90
69244 <- Module::method_added <internal:ast>:90
69244 -> Module::method_added <internal:ast>:98
69244 <- Module::method_added <internal:ast>:98
69244 -> Module::method_added <internal:ast>:106
69244 <- Module::method_added <internal:ast>:106
69244 -> Module::method_added <internal:ast>:114
69244 <- Module::method_added <internal:ast>:114
69244 -> Module::method_added <internal:ast>:122
69244 <- Module::method_added <internal:ast>:122
69244 -> Module::method_added <internal:ast>:133
69244 <- Module::method_added <internal:ast>:133
69244 -> Module::method_added <internal:ast>:141
69244 <- Module::method_added <internal:ast>:141
69244 -> BasicObject::singleton_method_added <internal:trace_point>:95
69244 <- BasicObject::singleton_method_added <internal:trace_point>:95
69244 -> Module::method_added <internal:trace_point>:104
69244 <- Module::method_added <internal:trace_point>:104
69244 -> BasicObject::singleton_method_added <internal:trace_point>:117
69244 <- BasicObject::singleton_method_added <internal:trace_point>:117
69244 -> BasicObject::singleton_method_added <internal:trace_point>:134
69244 <- BasicObject::singleton_method_added <internal:trace_point>:134
69244 -> Module::method_added <internal:trace_point>:195
69244 <- Module::method_added <internal:trace_point>:195
69244 -> Module::method_added <internal:trace_point>:231
69244 <- Module::method_added <internal:trace_point>:231
69244 -> Module::method_added <internal:trace_point>:239
69244 <- Module::method_added <internal:trace_point>:239
69244 -> Module::method_added <internal:trace_point>:246
69244 <- Module::method_added <internal:trace_point>:246
69244 -> Module::method_added <internal:trace_point>:251
69244 <- Module::method_added <internal:trace_point>:251
69244 -> Module::method_added <internal:trace_point>:256
69244 <- Module::method_added <internal:trace_point>:256
69244 -> Module::method_added <internal:trace_point>:262
69244 <- Module::method_added <internal:trace_point>:262
69244 -> Module::method_added <internal:trace_point>:267
69244 <- Module::method_added <internal:trace_point>:267
69244 -> Module::method_added <internal:trace_point>:272
69244 <- Module::method_added <internal:trace_point>:272
69244 -> Module::method_added <internal:trace_point>:308
69244 <- Module::method_added <internal:trace_point>:308
69244 -> Module::method_added <internal:trace_point>:313
69244 <- Module::method_added <internal:trace_point>:313
69244 -> Module::method_added <internal:trace_point>:321
69244 <- Module::method_added <internal:trace_point>:321
69244 -> Module::method_added <internal:trace_point>:326
69244 <- Module::method_added <internal:trace_point>:326
69244 -> Module::method_added <internal:trace_point>:331
69244 <- Module::method_added <internal:trace_point>:331
69244 -> Module::method_added <internal:trace_point>:337
69244 <- Module::method_added <internal:trace_point>:337
69244 -> Module::method_added <internal:trace_point>:345
69244 <- Module::method_added <internal:trace_point>:345
69244 -> Module::method_added <internal:pack>:133
69244 <- Module::method_added <internal:pack>:133
69244 -> Module::method_added <internal:pack>:256
69244 <- Module::method_added <internal:pack>:256
69244 -> Module::method_added <internal:pack>:280
69244 <- Module::method_added <internal:pack>:280
69244 -> Module::module_function <internal:warning>:5
69244 <- Module::module_function <internal:warning>:5
69244 -> Module::method_added <internal:warning>:50
69244 <- Module::method_added <internal:warning>:50
69244 -> BasicObject::singleton_method_added <internal:warning>:50
69244 <- BasicObject::singleton_method_added <internal:warning>:50
69244 -> Module::method_added <internal:array>:12
69244 <- Module::method_added <internal:array>:12
69244 -> Module::method_added <internal:array>:26
69244 <- Module::method_added <internal:array>:26
69244 -> Module::method_added <internal:array>:58
69244 <- Module::method_added <internal:array>:58
69244 -> Module::method_added <internal:kernel>:18
69244 <- Module::method_added <internal:kernel>:18
69244 -> Module::method_added <internal:kernel>:47
69244 <- Module::method_added <internal:kernel>:47
69244 -> Module::method_added <internal:kernel>:67
69244 <- Module::method_added <internal:kernel>:67
69244 -> Module::method_added <internal:kernel>:89
69244 <- Module::method_added <internal:kernel>:89
69244 -> Module::method_added <internal:kernel>:120
69244 <- Module::method_added <internal:kernel>:120
69244 -> Module::method_added <internal:kernel>:144
69244 <- Module::method_added <internal:kernel>:144
69244 -> Module::module_function <internal:kernel>:151
69244 <- Module::module_function <internal:kernel>:151
69244 -> Module::method_added <internal:kernel>:171
69244 <- Module::method_added <internal:kernel>:171
69244 -> BasicObject::singleton_method_added <internal:kernel>:171
69244 <- BasicObject::singleton_method_added <internal:kernel>:171
69244 -> Module::method_added <internal:prelude>:3
69244 <- Module::method_added <internal:prelude>:3
69244 -> RubyVM::FrozenCore::core#set_method_alias <internal:prelude>:9
69244 -> Module::method_added <internal:prelude>:9
69244 <- Module::method_added <internal:prelude>:9
69244 <- RubyVM::FrozenCore::core#set_method_alias <internal:prelude>:9
69244 -> Module::method_added <internal:prelude>:13
69244 <- Module::method_added <internal:prelude>:13
69244 -> RubyVM::FrozenCore::core#set_method_alias <internal:prelude>:19
69244 -> Module::method_added <internal:prelude>:19
69244 <- Module::method_added <internal:prelude>:19
69244 <- RubyVM::FrozenCore::core#set_method_alias <internal:prelude>:19
69244 -> Module::private <internal:prelude>:21
69244 <- Module::private <internal:prelude>:21
69244 -> Kernel::require <internal:gem_prelude>:2
69244 -> IO::set_encoding <internal:gem_prelude>:2
69244 <- IO::set_encoding <internal:gem_prelude>:2
69244 -> IO::set_encoding <internal:gem_prelude>:2
69244 <- IO::set_encoding <internal:gem_prelude>:2
69244 gc.mark.begin
69244 gc.sweep.begin
69244 gc.sweep.end
69244 gc.mark.end
69244 -> Kernel::require /usr/share/rubygems/rubygems.rb:8
69244 -> IO::set_encoding /usr/share/rubygems/rubygems.rb:8
69244 <- IO::set_encoding /usr/share/rubygems/rubygems.rb:8
69244 -> IO::set_encoding /usr/share/rubygems/rubygems.rb:8
69244 <- IO::set_encoding /usr/share/rubygems/rubygems.rb:8
69244 -> String::start_with? /usr/lib64/ruby/rbconfig.rb:12
69244 <- String::start_with? /usr/lib64/ruby/rbconfig.rb:12
69244 -> File::dirname /usr/lib64/ruby/rbconfig.rb:16
69244 <- File::dirname /usr/lib64/ruby/rbconfig.rb:16
69244 -> String::chomp! /usr/lib64/ruby/rbconfig.rb:16
69244 <- String::chomp! /usr/lib64/ruby/rbconfig.rb:16
69244 gc.sweep.begin
</code></pre>
<p>And somebody might wonder what is the state of the object which should supposedly hold the <code>classname</code>:</p>
<pre><code>(gdb) call ruby_debug_print_v(rb_mRubyVMFrozenCore)
DBG> : 0x00000001000a09c8 [3LM R ] T_ICLASS
(gdb) p *(*(struct RClass *)(rb_mRubyVMFrozenCore))->ptr.iv_tbl.entries
$4 = {hash = 30421, key = 3809, record = 4295625080}
(gdb) p *(struct RBasic *)(4295625080)
$5 = {flags = 0, klass = 4295624320}
(gdb) call ruby_debug_print_v(4295625080)
DBG> : 0x00000001000a0978 [0 ] T_NONE
</code></pre>
<p>So while the <code>rb_mRubyVMFrozenCore</code> is still the same, the description object changed to <code>T_NONE</code>. Running even further, the content changes again in <code>rb_dtrace_setup</code> call:</p>
<pre><code>(gdb) c
Continuing.
Watchpoint 2: ((struct RBasic *)(4295625080))->klass
Old value = 4295624320
New value = 4295927560
0x00007ffff7bed4b4 in rb_wb_protected_newobj_of (klass=4295927560, flags=5) at gc.c:2356
2356 }
(gdb) bt
#0 0x00007ffff7bed4b4 in rb_wb_protected_newobj_of (klass=4295927560, flags=5) at gc.c:2356
#1 0x00007ffff7d4b86c in str_alloc (klass=<optimized out>) at string.c:773
#2 str_duplicate (str=4295960160, klass=<optimized out>) at string.c:1601
#3 rb_str_dup (str=4295960160) at string.c:1608
#4 0x00007ffff7da72ac in rb_class_path (klass=4295960120) at variable.c:173
#5 0x00007ffff7dc46a4 in rb_dtrace_setup (ec=<optimized out>, klass=4295960120, id=3137, args=0x7fffffffa198) at vm.c:449
#6 0x00007ffff7dd83c4 in vm_call0_cfunc_with_frame (argv=0x7fffffffa330, calling=0x7fffffffa1b8, ec=0x100031cf0) at vm_eval.c:124
#7 vm_call0_cfunc (argv=0x7fffffffa330, calling=0x7fffffffa1b8, ec=0x100031cf0) at vm_eval.c:149
#8 vm_call0_body (ec=ec@entry=0x100031cf0, calling=calling@entry=0x7fffffffa278, argv=argv@entry=0x7fffffffa330) at vm_eval.c:180
#9 0x00007ffff7ddb9a0 in vm_call0_cc (kw_splat=0, cc=0x100211230, argv=0x7fffffffa330, argc=1, id=3137, recv=4295625120, ec=0x100031cf0) at vm_eval.c:72
#10 rb_funcallv_scope (scope=CALL_FCALL, argv=0x7fffffffa330, argc=1, mid=3137, recv=4295625120) at vm_eval.c:1006
#11 rb_funcallv (recv=4295625120, mid=3137, argc=<optimized out>, argv=0x7fffffffa330) at vm_eval.c:1026
#12 0x00007ffff7c88f60 in rb_obj_dup (obj=<error reading variable: value has been optimized out>) at object.c:568
#13 rb_obj_dup (obj=<error reading variable: value has been optimized out>) at object.c:559
#14 0x00007ffff7daf4e4 in ractor_safe_call_cfunc_0 (recv=<optimized out>, argc=<optimized out>, argv=<optimized out>, func=<optimized out>) at vm_insnhelper.c:2743
#15 0x00007ffff7dc4900 in vm_call_cfunc_with_frame (ec=0x100031cf0, reg_cfp=0x7ffff75afe18, calling=<optimized out>) at vm_insnhelper.c:2926
#16 0x00007ffff7dc7644 in vm_sendish (ec=0x100031cf0, reg_cfp=0x7ffff75afe18, cd=0x100218e70, block_handler=<optimized out>, method_explorer=<optimized out>) at vm_callinfo.h:336
#17 0x00007ffff7dcba5c in vm_exec_core (ec=0x100031cf0, initial=<optimized out>, initial@entry=0) at insns.def:789
#18 0x00007ffff7dd1710 in rb_vm_exec (ec=0x100031cf0, mjit_enable_p=<optimized out>) at vm.c:2172
#19 0x00007ffff7dd5b4c in invoke_block (captured=<optimized out>, captured=<optimized out>, opt_pc=<optimized out>, type=<optimized out>, cref=0x0, self=<optimized out>, iseq=<optimized out>, ec=0x100031cf0)
at vm.c:1263
#20 invoke_iseq_block_from_c (me=0x0, is_lambda=<optimized out>, cref=0x0, passed_block_handler=0, kw_splat=0, argv=<optimized out>, argc=2, self=<optimized out>, captured=<optimized out>, ec=0x100031cf0)
at vm.c:1335
#21 invoke_block_from_c_bh (ec=0x100031cf0, block_handler=<optimized out>, argc=<optimized out>, argv=<optimized out>, kw_splat=<optimized out>, passed_block_handler=0, cref=0x0, is_lambda=<optimized out>,
force_blockarg=0) at vm.c:1353
#22 0x00007ffff7dd6db4 in vm_yield (kw_splat=0, argv=0x7fffffffac68, argc=2, ec=<optimized out>) at vm.c:1398
#23 rb_yield_0 (argv=0x7fffffffac68, argc=2) at vm_eval.c:1331
#24 rb_yield_values2 (argc=<optimized out>, argv=0x7fffffffac68) at vm_eval.c:1377
#25 0x00007ffff7bf0300 in each_pair_i_fast (key=<optimized out>, value=<optimized out>, _=<optimized out>) at hash.c:3116
#26 0x00007ffff7beffe4 in hash_foreach_iter (key=<optimized out>, value=<optimized out>, argp=140737488335344, error=<optimized out>) at hash.c:1378
#27 0x00007ffff7d37378 in st_general_foreach (tab=0x100202120, func=0x7ffff7beffa0 <hash_foreach_iter>, replace=0x0, arg=140737488335344, check_p=<optimized out>) at st.c:1473
#28 0x00007ffff7bf3ba0 in hash_foreach_call (arg=140737488335344) at hash.c:1507
#29 0x00007ffff7bc2fa0 in rb_ensure (b_proc=0x7ffff7bf3a60 <hash_foreach_call>, data1=140737488335344, e_proc=0x7ffff7bf1f80 <hash_foreach_ensure>, data2=<optimized out>) at eval.c:1162
#30 0x00007ffff7bf63c0 in rb_hash_foreach (farg=0, func=0x7ffff7bf02c0 <each_pair_i_fast>, hash=4295229560) at hash.c:1527
#31 rb_hash_foreach (hash=4295229560, func=0x7ffff7bf02c0 <each_pair_i_fast>, farg=0) at hash.c:1517
#32 0x00007ffff7bf7480 in rb_hash_each_pair (hash=4295229560) at hash.c:3153
#33 0x00007ffff7daf4e4 in ractor_safe_call_cfunc_0 (recv=<optimized out>, argc=<optimized out>, argv=<optimized out>, func=<optimized out>) at vm_insnhelper.c:2743
#34 0x00007ffff7dc4900 in vm_call_cfunc_with_frame (ec=0x100031cf0, reg_cfp=0x7ffff75afe88, calling=<optimized out>) at vm_insnhelper.c:2926
#35 0x00007ffff7dc7644 in vm_sendish (ec=0x100031cf0, reg_cfp=0x7ffff75afe88, cd=0x10022b6e0, block_handler=<optimized out>, method_explorer=<optimized out>) at vm_callinfo.h:336
#36 0x00007ffff7dcbac8 in vm_exec_core (ec=0x100031cf0, initial=<optimized out>, initial@entry=0) at insns.def:770
#37 0x00007ffff7dd1710 in rb_vm_exec (ec=0x100031cf0, mjit_enable_p=<optimized out>) at vm.c:2172
#38 0x00007ffff7dd29f4 in rb_iseq_eval (iseq=0x10004a410) at vm.c:2409
#39 0x00007ffff7c2ce68 in load_iseq_eval (fname=4295431320, ec=0x100031cf0) at load.c:594
#40 require_internal (ec=ec@entry=0x100031cf0, fname=<optimized out>, fname@entry=4295211000, exception=exception@entry=1) at load.c:1065
#41 0x00007ffff7c2e7f4 in rb_require_string (fname=4295211000) at load.c:1142
#42 0x00007ffff7c2e88c in rb_f_require (obj=<optimized out>, fname=<optimized out>) at load.c:838
#43 0x00007ffff7daf538 in ractor_safe_call_cfunc_1 (recv=<optimized out>, argc=<optimized out>, argv=<optimized out>, func=<optimized out>) at vm_insnhelper.c:2750
#44 0x00007ffff7dc4900 in vm_call_cfunc_with_frame (ec=0x100031cf0, reg_cfp=0x7ffff75aff30, calling=<optimized out>) at vm_insnhelper.c:2926
#45 0x00007ffff7dc7644 in vm_sendish (ec=0x100031cf0, reg_cfp=0x7ffff75aff30, cd=0x100121e10, block_handler=<optimized out>, method_explorer=<optimized out>) at vm_callinfo.h:336
#46 0x00007ffff7dcba5c in vm_exec_core (ec=0x100031cf0, initial=<optimized out>, initial@entry=0) at insns.def:789
#47 0x00007ffff7dd1710 in rb_vm_exec (ec=0x100031cf0, mjit_enable_p=<optimized out>) at vm.c:2172
#48 0x00007ffff7dd29f4 in rb_iseq_eval (iseq=0x10003b988) at vm.c:2409
#49 0x00007ffff7c2ce68 in load_iseq_eval (fname=4295394400, ec=0x100031cf0) at load.c:594
#50 require_internal (ec=ec@entry=0x100031cf0, fname=<optimized out>, fname@entry=4295394680, exception=exception@entry=1) at load.c:1065
--Type <RET> for more, q to quit, c to continue without paging--q
Quit
(gdb) p *(*(struct RClass *)(rb_mRubyVMFrozenCore))->ptr.iv_tbl.entries
$10 = {hash = 30421, key = 3809, record = 4295625080}
(gdb) p *(struct RBasic *)(4295625080)
$11 = {flags = 0, klass = 4295927560}
</code></pre>
<p>I am not really sure what happens after this point ...</p>
<p>However, my assumption is that <code>RubyVM::FrozenCore::core#set_method_alias</code> in its form won't apper in the log anymore and there will be some rubbish instead.</p>
<p>[1] <a href="https://github.com/ruby/ruby/blob/v3_0_2/vm.c#L3388" class="external">https://github.com/ruby/ruby/blob/v3_0_2/vm.c#L3388</a></p>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=96442
2022-02-09T16:37:36Z
vo.x (Vit Ondruch)
v.ondruch@tiscali.cz
<ul><li><strong>Subject</strong> changed from <i>SystemTap/DTrace coredump</i> to <i>rb_mRubyVMFrozenCore is broken by GC run</i></li></ul><p>To demonstrate the issue without SystemTap using Ruby 3.1.0, I have created the following patch:</p>
<pre><code>$ git diff
diff --git a/gc.c b/gc.c
index d77dc2cda4..6a00742209 100644
--- a/gc.c
+++ b/gc.c
@@ -5627,6 +5627,9 @@ gc_sweep_finish(rb_objspace_t *objspace)
static int
gc_sweep_step(rb_objspace_t *objspace, rb_size_pool_t *size_pool, rb_heap_t *heap)
{
+ VALUE path = rb_class_path_cached(rb_mRubyVMFrozenCore);
+ printf("Before sweep: %s\n", RSTRING_PTR(path));
+
struct heap_page *sweep_page = heap->sweeping_page;
int unlink_limit = 3;
@@ -5714,6 +5717,9 @@ gc_sweep_step(rb_objspace_t *objspace, rb_size_pool_t *size_pool, rb_heap_t *hea
gc_prof_sweep_timer_stop(objspace);
#endif
+ path = rb_class_path_cached(rb_mRubyVMFrozenCore);
+ printf("After sweep: %s\n", RSTRING_PTR(path));
+
return heap->free_pages != NULL;
}
@@ -8138,6 +8144,9 @@ gc_marks_continue(rb_objspace_t *objspace, rb_size_pool_t *size_pool, rb_heap_t
static void
gc_marks(rb_objspace_t *objspace, int full_mark)
{
+ VALUE path = rb_class_path_cached(rb_mRubyVMFrozenCore);
+ printf("Before mark: %s\n", RSTRING_PTR(path));
+
gc_prof_mark_timer_start(objspace);
/* setup marking */
@@ -8154,6 +8163,9 @@ gc_marks(rb_objspace_t *objspace, int full_mark)
}
#endif
gc_prof_mark_timer_stop(objspace);
+
+ path = rb_class_path_cached(rb_mRubyVMFrozenCore);
+ printf("After mark: %s\n", RSTRING_PTR(path));
}
/* RGENGC */
</code></pre>
<p>With simple test case, it produces this output:</p>
<pre><code>$ ./miniruby -e "10000.times {[1].push[2]}"
Before mark: RubyVM::FrozenCore
Before sweep: RubyVM::FrozenCore
After sweep: RubyVM::FrozenCore
After mark: RubyVM::FrozenCore
Before sweep: RubyVM::FrozenCore
After sweep: RubyVM::FrozenCore
RSTRING_PTR is returning NULL!! SIGSEGV is highly expected to follow immediately. If you could reproduce, attach your debugger here, and look at the passed string.Before mark: (null)
RSTRING_PTR is returning NULL!! SIGSEGV is highly expected to follow immediately. If you could reproduce, attach your debugger here, and look at the passed string.Before sweep: (null)
RSTRING_PTR is returning NULL!! SIGSEGV is highly expected to follow immediately. If you could reproduce, attach your debugger here, and look at the passed string.After sweep: (null)
RSTRING_PTR is returning NULL!! SIGSEGV is highly expected to follow immediately. If you could reproduce, attach your debugger here, and look at the passed string.After mark: (null)
RSTRING_PTR is returning NULL!! SIGSEGV is highly expected to follow immediately. If you could reproduce, attach your debugger here, and look at the passed string.Before sweep: (null)
After sweep:
RSTRING_PTR is returning NULL!! SIGSEGV is highly expected to follow immediately. If you could reproduce, attach your debugger here, and look at the passed string.Before mark: (null)
RSTRING_PTR is returning NULL!! SIGSEGV is highly expected to follow immediately. If you could reproduce, attach your debugger here, and look at the passed string.Before sweep: (null)
RSTRING_PTR is returning NULL!! SIGSEGV is highly expected to follow immediately. If you could reproduce, attach your debugger here, and look at the passed string.After sweep: (null)
RSTRING_PTR is returning NULL!! SIGSEGV is highly expected to follow immediately. If you could reproduce, attach your debugger here, and look at the passed string.After mark: (null)
RSTRING_PTR is returning NULL!! SIGSEGV is highly expected to follow immediately. If you could reproduce, attach your debugger here, and look at the passed string.Before sweep: (null)
After sweep:
</code></pre>
<p>With more complex examples which are part of Ruby build:</p>
<pre><code>$ ./miniruby -I./lib -I. -I.ext/common ./tool/generic_erb.rb -c -o encdb.h ./template/encdb.h.tmpl ./enc enc
Before mark: RubyVM::FrozenCore
Before sweep: RubyVM::FrozenCore
After sweep: RubyVM::FrozenCore
After mark: RubyVM::FrozenCore
Before sweep: RubyVM::FrozenCore
After sweep: RubyVM::FrozenCore
Before mark: module_function :def_erb_method
Before sweep: module_function :def_erb_method
After sweep: module_function :def_erb_method
After mark: module_function :def_erb_method
Before sweep: module_function :def_erb_method
After sweep: $
Before mark: end
Before sweep: end
After sweep: end
After mark: end
/builddir/build/BUILD/ruby-3.1.0/lib/erb.rb:474: [BUG] Segmentation fault at 0x0000000000009619
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0014 p:---- s:0088 e:000087 CFUNC :scan
c:0013 p:0008 s:0083 e:000082 METHOD /builddir/build/BUILD/ruby-3.1.0/lib/erb.rb:474 [FINISH]
c:0012 p:---- s:0078 e:000077 CFUNC :call
c:0011 p:0028 s:0073 e:000072 METHOD /builddir/build/BUILD/ruby-3.1.0/lib/erb.rb:417
c:0010 p:0009 s:0067 e:000066 BLOCK /builddir/build/BUILD/ruby-3.1.0/lib/erb.rb:407 [FINISH]
c:0009 p:---- s:0063 e:000062 CFUNC :each_line
c:0008 p:0015 s:0059 e:000058 METHOD /builddir/build/BUILD/ruby-3.1.0/lib/erb.rb:406
c:0007 p:0088 s:0054 E:0001a8 METHOD /builddir/build/BUILD/ruby-3.1.0/lib/erb.rb:593
c:0006 p:0140 s:0045 e:000044 METHOD /builddir/build/BUILD/ruby-3.1.0/lib/erb.rb:827 [FINISH]
c:0005 p:---- s:0033 e:000032 CFUNC :new
c:0004 p:0048 s:0027 e:000026 BLOCK ./tool/generic_erb.rb:36 [FINISH]
c:0003 p:---- s:0022 e:000021 CFUNC :map
c:0002 p:0106 s:0018 E:000f00 EVAL ./tool/generic_erb.rb:34 [FINISH]
c:0001 p:0000 s:0003 E:0018d0 (none) [FINISH]
-- Ruby level backtrace information ----------------------------------------
./tool/generic_erb.rb:34:in `<main>'
./tool/generic_erb.rb:34:in `map'
./tool/generic_erb.rb:36:in `block in <main>'
./tool/generic_erb.rb:36:in `new'
/builddir/build/BUILD/ruby-3.1.0/lib/erb.rb:827:in `initialize'
/builddir/build/BUILD/ruby-3.1.0/lib/erb.rb:593:in `compile'
/builddir/build/BUILD/ruby-3.1.0/lib/erb.rb:406:in `scan'
/builddir/build/BUILD/ruby-3.1.0/lib/erb.rb:406:in `each_line'
/builddir/build/BUILD/ruby-3.1.0/lib/erb.rb:407:in `block in scan'
/builddir/build/BUILD/ruby-3.1.0/lib/erb.rb:417:in `percent_line'
/builddir/build/BUILD/ruby-3.1.0/lib/erb.rb:417:in `call'
/builddir/build/BUILD/ruby-3.1.0/lib/erb.rb:474:in `explicit_trim_line'
/builddir/build/BUILD/ruby-3.1.0/lib/erb.rb:474:in `scan'
-- Machine register context ------------------------------------------------
RIP: 0x00007f8be6ecd4bd RBP: 0x00007f8be6f465a0 RSP: 0x00007ffd889a0fb8
RAX: 0x0000000000000619 RBX: 0x0000000000000073 RCX: 0x00007f8be6f02460
RDX: 0x0000000000009619 RDI: 0x0000000000009619 RSI: 0x00007f8be6f024e0
R8: 0x00007f8be6f023e0 R9: 0x0000000000000000 R10: 0x0000000000000000
R11: 0x0000000000000000 R12: 0x000000000000000e R13: 0x00000000ffffffff
R14: 0x0000000000009619 R15: 0x00007ffd889a1510 EFL: 0x0000000000010287
-- C level backtrace information -------------------------------------------
./miniruby(rb_print_backtrace+0x19) [0x564965148c49]
./miniruby(rb_vm_bugreport+0x219) [0x56496514c7f9]
./miniruby(rb_bug_for_fatal_signal+0xf4) [0x564964f75204]
./miniruby(sigsegv+0x4f) [0x5649650bad7f]
[0x7f8be6d94700]
[0x7f8be6ecd4bd]
[0x7f8be6dc44b1]
[0x7f8be6e71b4b]
./miniruby(gc_sweep_step.isra.0+0x7b) [0x56496518797b]
./miniruby(heap_prepare.lto_priv.0+0x54) [0x564964f99754]
./miniruby(newobj_slowpath_wb_protected.constprop.0+0x136) [0x5649651715c6]
./miniruby(rb_wb_protected_newobj_of+0x8e) [0x564964f901de]
./miniruby(str_new0.lto_priv.0+0x6b) [0x5649650c4cbb]
./miniruby(rb_str_subseq+0x9f) [0x5649650cd8af]
./miniruby(scan_once+0x11b) [0x5649650ddeab]
./miniruby(rb_str_scan.lto_priv.0+0x108) [0x5649650de128]
./miniruby(vm_call_cfunc_with_frame+0x125) [0x564965125555]
./miniruby(vm_sendish.lto_priv.0+0x4ba) [0x564965126dea]
./miniruby(vm_exec_core.lto_priv.0+0x6bf) [0x56496512f9ff]
./miniruby(rb_vm_exec+0xc9) [0x564965146169]
./miniruby(rb_vm_call0+0xe4) [0x564965139e04]
./miniruby(rb_method_call_with_block_kw+0x7f) [0x56496505ba5f]
./miniruby(vm_call_cfunc_with_frame+0x125) [0x564965125555]
./miniruby(vm_sendish.lto_priv.0+0x4ba) [0x564965126dea]
./miniruby(vm_exec_core.lto_priv.0+0x6bf) [0x56496512f9ff]
./miniruby(rb_vm_exec+0xc9) [0x564965146169]
./miniruby(rb_yield+0x78) [0x564965136288]
./miniruby(rb_str_enumerate_lines+0x588) [0x5649650e0bb8]
./miniruby(vm_call_cfunc_with_frame+0x125) [0x564965125555]
./miniruby(vm_sendish.lto_priv.0+0x4ba) [0x564965126dea]
./miniruby(vm_exec_core.lto_priv.0+0x6bf) [0x56496512f9ff]
./miniruby(rb_vm_exec+0xc9) [0x564965146169]
./miniruby(rb_call0.lto_priv.0+0x1e1) [0x5649651387d1]
./miniruby(rb_obj_call_init_kw+0x85) [0x564964f7d5b5]
./miniruby(rb_class_new_instance_pass_kw+0x58) [0x56496502dfb8]
./miniruby(vm_call_cfunc_with_frame+0x125) [0x564965125555]
./miniruby(vm_sendish.lto_priv.0+0x4ba) [0x564965126dea]
./miniruby(vm_exec_core.lto_priv.0+0x82) [0x56496512f3c2]
./miniruby(rb_vm_exec+0xc9) [0x564965146169]
./miniruby(rb_yield+0x78) [0x564965136288]
./miniruby(rb_ary_collect.lto_priv.0+0x12c) [0x564964ef954c]
./miniruby(vm_call_cfunc_with_frame+0x125) [0x564965125555]
./miniruby(vm_sendish.lto_priv.0+0x4ba) [0x564965126dea]
./miniruby(vm_exec_core.lto_priv.0+0x6bf) [0x56496512f9ff]
./miniruby(rb_vm_exec+0xc9) [0x564965146169]
./miniruby(rb_ec_exec_node+0xa7) [0x564964f7e927]
./miniruby(ruby_run_node+0x69) [0x564964f83d79]
./miniruby(main+0x5f) [0x564964ef201f]
</code></pre>
<p>For my original case triggered by DTrace probe, I'll probably avoid reporting anything for <code>rb_mRubyVMFrozenCore</code> or I special case the class name there.</p>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=96463
2022-02-10T12:36:16Z
vo.x (Vit Ondruch)
v.ondruch@tiscali.cz
<ul></ul><p>Going to apply the following workaround until this is fixed:</p>
<pre><code class="diff syntaxhl" data-language="diff"><span class="p">From 0ade5611df9f981005eed32b369d1e699e520221 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Thu, 10 Feb 2022 13:26:44 +0100
Subject: [PATCH] Don't query `RubyVM::FrozenCore` for class path.
</span><span class="err">
</span><span class="p">The `RubyVM::FrozenCore` class path is corrupted during GC cycle and
returns random garbage, which might result in segfault.
</span><span class="err">
</span><span class="p">But since it is easy to detect the `RubyVM::FrozenCore`, just provide
the class path explicitly as a workaround.
</span><span class="err">
</span><span class="p">Other possibility would be to ignore `RubyVM::FrozenCore` simlarly as
TracePoint API does:
</span><span class="err">
</span><span class="p">https://github.com/ruby/ruby/blob/46f6575157d4c2f6bbd5693896e26a65037e5552/vm_trace.c#L411
---
</span> vm.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
<span class="err">
</span><span class="gh">diff --git a/vm.c b/vm.c
index 8ce8b279d4..3d189fa63a 100644
</span><span class="gd">--- a/vm.c
</span><span class="gi">+++ b/vm.c
</span><span class="p">@@ -479,7 +479,15 @@</span> rb_dtrace_setup(rb_execution_context_t *ec, VALUE klass, ID id,
}
type = BUILTIN_TYPE(klass);
if (type == T_CLASS || type == T_ICLASS || type == T_MODULE) {
<span class="gd">- VALUE name = rb_class_path(klass);
</span><span class="gi">+ VALUE name = Qnil;
+ /*
+ * Special treatment for rb_mRubyVMFrozenCore wchi is broken by GC.
+ * https://bugs.ruby-lang.org/issues/18257
+ */
+ if (klass == rb_mRubyVMFrozenCore)
+ name = rb_str_new_cstr("RubyVM::FrozenCore");
+ else
+ name = rb_class_path(klass);
</span> const char *classname, *filename;
const char *methodname = rb_id2name(id);
if (methodname && (filename = rb_source_location_cstr(&args->line_no)) != 0) {
<span class="gd">--
</span><span class="p">2.34.1
</span></code></pre>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=104353
2023-08-25T17:17:55Z
jeremyevans0 (Jeremy Evans)
merch-redmine@jeremyevans.net
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Feedback</i></li></ul><p><a class="user active user-mention" href="https://bugs.ruby-lang.org/users/703">@vo.x (Vit Ondruch)</a> This may have been fixed by <a class="changeset" title="Directly allocate FrozenCore as an ICLASS It's a bad idea to overwrite the flags as the garbage ..." href="https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/813a5f4fc46a24ca1695d23c159250b9e1080ac7">813a5f4fc46a24ca1695d23c159250b9e1080ac7</a>, can you see if this is still a problem?</p>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=104568
2023-09-13T14:37:17Z
vo.x (Vit Ondruch)
v.ondruch@tiscali.cz
<ul></ul><p>I don't think this is resolved, at least to the full extent. Trying again with the patch from comment <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: rb_mRubyVMFrozenCore is broken by GC run (Closed)" href="https://bugs.ruby-lang.org/issues/18257#note-13">#18257-13</a> and this is the results:</p>
<pre><code>$ ./miniruby -v
ruby 3.3.0dev (2023-09-05 master 7c8932365f) [x86_64-linux]
$ ./miniruby -e "10000.times {[1].push[2]}"
Before mark: RubyVM::FrozenCore
After mark: RubyVM::FrozenCore
Before sweep: RubyVM::FrozenCore
After sweep: RubyVM::FrozenCore
Before sweep: RubyVM::FrozenCore
After sweep: RubyVM::FrozenCore
Before sweep: RubyVM::FrozenCore
After sweep: RubyVM::FrozenCore
Before sweep: RubyVM::FrozenCore
After sweep: RubyVM::FrozenCore
Before sweep: RubyVM::FrozenCore
After sweep: RubyVM::FrozenCore
Before sweep: RubyVM::FrozenCore
After sweep: RubyVM::FrozenCore
Before sweep: RubyVM::FrozenCore
Before sweep: RubyVM::FrozenCore
Before sweep: RubyVM::FrozenCore
Before sweep: RubyVM::FrozenCore
Before mark: RubyVM::FrozenCore
After mark: RubyVM::FrozenCore
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
After sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
After sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
After sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
After sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
After sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
After sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before mark: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
After mark: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
After sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
After sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
After sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
After sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
After sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
After sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before mark: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
After mark: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
After sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
After sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
After sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
After sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
After sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
Before sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
After sweep: OFFSETOF((*((struct rb_iseq_struct *)NULL)), aux)
</code></pre>
<p>Either the patch is completely off or something strange happens somewhere with the <code>rb_mRubyVMFrozenCore</code></p>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=104622
2023-09-15T13:13:55Z
vo.x (Vit Ondruch)
v.ondruch@tiscali.cz
<ul></ul><p>Trying to reproduce all the steps, I still observe the behavior as described in comment <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: rb_mRubyVMFrozenCore is broken by GC run (Closed)" href="https://bugs.ruby-lang.org/issues/18257#note-12">#18257-12</a>. I'll keep around the patch as described in <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: rb_mRubyVMFrozenCore is broken by GC run (Closed)" href="https://bugs.ruby-lang.org/issues/18257#note-14">#18257-14</a> until this is fixed properly.</p>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=104653
2023-09-19T05:09:46Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Open</i></li></ul>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=104654
2023-09-19T05:11:54Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Applied in changeset <a class="changeset" title="[Bug #18257] Register the class path of FrozenCore to mark ICLASS does not have the path usually..." href="https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/647390308239fbf82d159ecd83ed8df090af518d">git|647390308239fbf82d159ecd83ed8df090af518d</a>.</p>
<hr>
<p>[Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: rb_mRubyVMFrozenCore is broken by GC run (Closed)" href="https://bugs.ruby-lang.org/issues/18257">#18257</a>] Register the class path of FrozenCore to mark</p>
<p>ICLASS does not have the path usually, so it needs to be registered<br>
separately.</p>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=104655
2023-09-19T05:12:49Z
nobu (Nobuyoshi Nakada)
nobu@ruby-lang.org
<ul><li><strong>Backport</strong> changed from <i>2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN</i> to <i>3.0: REQUIRED, 3.1: REQUIRED, 3.2: REQUIRED</i></li></ul>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=104658
2023-09-19T06:23:42Z
vo.x (Vit Ondruch)
v.ondruch@tiscali.cz
<ul></ul><p>Thx a lot!</p>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=104659
2023-09-19T06:43:23Z
vo.x (Vit Ondruch)
v.ondruch@tiscali.cz
<ul></ul><p>BTW I still wonder what is the reason for <a href="https://github.com/ruby/ruby/blob/647390308239fbf82d159ecd83ed8df090af518d/vm_trace.c#L431" class="external">1</a>:</p>
<pre><code> if (ec->trace_arg == NULL && /* check reentrant */
trace_arg->self != rb_mRubyVMFrozenCore /* skip special methods. TODO: remove it. */) {
</code></pre>
<p>This was introduced in <a class="changeset" title="* vm_core.h (exec_event_hooks): skips RubyVM::FrozenCore. git-svn-id: svn+ssh://ci.ruby-lang.or..." href="https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/1be7c799e6ed39f7ac41906c05db149e8c391add">git|1be7c799e6ed39f7ac41906c05db149e8c391add</a> but hard to guess what was the reason. If there were issues or if it is by design.</p>
Ruby master - Bug #18257: rb_mRubyVMFrozenCore is broken by GC run
https://bugs.ruby-lang.org/issues/18257?journal_id=104660
2023-09-19T06:51:03Z
vo.x (Vit Ondruch)
v.ondruch@tiscali.cz
<ul></ul><p>The <code>TODO</code> part was introduced by <a class="changeset" title="* vm_trace.c, vm_core.h: simplify tracing mechanism. (1) add rb_hook_list_t data structure whic..." href="https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/4a4a702e61d1c5585d522f1185a82a5685c554f6">git|4a4a702e61d1c5585d522f1185a82a5685c554f6</a> which also does not give a clue what is intention here.</p>
<p>Generally, my point is that it is strange that DTrace would report about rb_mRubyVMFrozenCore while TracePoint is happy to skip it.</p>