
Issue #21021 has been updated by alanwu (Alan Wu). The following patch combined with the crash output should narrow the culprit down to a couple entries in the stack trace. It prints an index of the "Ruby level backtrace information" section, but it relies on a heuristic so could be off by a small amount. You can then try putting `GC.stress = true/false` around a region of code mentioned in the stack trace to further narrow things down. It should up the crash rate, and if it does, that shows the bug is somewhere in the stress region. ```patch diff --git a/gc.c b/gc.c index e4b564a38d..1983501231 100644 --- a/gc.c +++ b/gc.c @@ -2320,7 +2320,14 @@ rb_gc_mark_values(long n, const VALUE *values) void rb_gc_mark_vm_stack_values(long n, const VALUE *values) { + int frame_flag_count = 0; for (long i = 0; i < n; i++) { + if (VM_FRAME_MAGIC_METHOD <= values[i] && values[i] < 0x80000000ul) { // see VM_FRAME_MAGIC_MASK + frame_flag_count++; + } + if (RB_TYPE_P(values[i], T_NONE)) { + rb_bug("T_NONE on stack. Seems to be from %dth frame", frame_flag_count); + } gc_mark_and_pin_internal(values[i]); } } ``` ---------------------------------------- Bug #21021: "try to mark T_NONE object" with 3.4.1 https://bugs.ruby-lang.org/issues/21021#change-111628 * Author: Benoit_Tigeot (Benoit Tigeot) * Status: Open * ruby -v: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +YJIT +PRISM [x86_64-linux] │ * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- Hello We upgraded to 3.4.1 yesterday but we are seeing crash since then. ``` /bundle/ruby/3.4.0/gems/activejob-7.2.2.1/lib/active_job/enqueuing.rb:93: [BUG] try to mark T_NONE object ``` I saw the other issue related to ffi gem https://bugs.ruby-lang.org/issues/20694 But in our case the `C level backtrace information` looks different. https://gist.github.com/benoittgt/13507c2000281aa7740bc782adab68c5 We migrated this part of the code to parallel->concurrent-ruby and we do not see the error yet again but I am a little bit worried we could see the issue again. -- https://bugs.ruby-lang.org/