Bug #13537


ruby crash in rb_gc_mark

Added by viamin (Bart Agapinan) over 6 years ago. Updated about 6 years ago.

Target version:
ruby -v:


ruby crashes on me fairly regularly while working on a rails app. It happens after a file has changed and the guard gem fires up some tests. It appears to be happening when running rubycritic via guard:

running flay smells

running flog smells
running reek smells
running complexity
running attributes
running churn
/usr/local/var/rbenv/versions/2.4.1/lib/ruby/2.4.0/pathname.rb:41: [BUG] rb_gc_mark(): 0x007fd0efd68a68 is T_NONE
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]


ruby_2017-05-02-065959_Barts-iMac.crash (27.2 KB) ruby_2017-05-02-065959_Barts-iMac.crash viamin (Bart Agapinan), 05/02/2017 02:21 PM
bug-13537.log (159 KB) bug-13537.log nobu (Nobuyoshi Nakada), 05/02/2017 05:49 PM

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #13605: GC bug calling `ObjectSpace.each_object`ClosedActions

Updated by ko1 (Koichi Sasada) over 6 years ago

It should be marking miss failure.
Could you give us the way to reproduce it?

Actions #2

Updated by nobu (Nobuyoshi Nakada) over 6 years ago

Updated by kwilczynski (Krzysztof Wilczynski) over 6 years ago

I can confirm having the same issue. It's intermediate but reproducible, and affects both 2.4.0 and 2.4.1 versions.

The setup is simple:

  • OS X (macOS 10.12.5 with latest patches)
  • XCode command line tools (also latest)
  • rbenv with ruby-install (installed via Homebrew)

The guard Ruby gem is installed and run using fsnotify events to trigger builds, and it would randomly crash Ruby interpreter. Sometimes at the very beginning, sometimes after running a while.

Since I test against multiple Ruby versions, I can confirm that this does not happen on 2.2.6 and 2.3.3, only 2.4.x family is affected.

Updated by ko1 (Koichi Sasada) over 6 years ago

If you can modify MRI source code, please try to change RGENGC_CHECK_MODE in gc.c to 2 and run your program on your modified MRI again.
It will inserts many assertions and it may help.


Updated by wanabe (_ wanabe) about 6 years ago

Is this same to #13605 and fixed at r59063?

Actions #6

Updated by wanabe (_ wanabe) about 6 years ago

  • Related to Bug #13605: GC bug calling `ObjectSpace.each_object` added

Updated by djellemah (John Anderson) about 6 years ago

I get the same error running the Pry rspec suite.

[BUG] rb_gc_mark(): 0x000000036d2bc8 is T_NONE

The value 0x000000036d2bc8 varies.

Using ruby 2.4.2p161 (2017-07-23 revision 59409) [x86_64-linux]

When I change RGENGC_CHECK_MODE in gc.c to 2, it fails every time and I get this output

verify_internal_consistency_reachable_i: WB miss (O->Y) 0x0000000003db1110 [3LM  ] T_IMEMO env -> 0x00000000036fb8e8 [0    ] T_OBJECT (Pry)
verify_internal_consistency_reachable_i: WB miss (O->Y) 0x0000000003db1200 [3LM  ] T_IMEMO env -> 0x00000000036f8170 [0    ] T_OBJECT (Pry::HistoryArray)
verify_internal_consistency_reachable_i: WB miss (O->Y) 0x0000000003db12f0 [3LM  ] T_IMEMO env -> 0x00000000036f8288 [0    ] T_OBJECT (Pry::HistoryArray)
/home/panic/src/pry/lib/pry/core_extensions.rb:87: [BUG] gc_verify_internal_consistency: found internal inconsistency.
ruby 2.4.2p161 (2017-07-23 revision 59409) [x86_64-linux]

Updated by ko1 (Koichi Sasada) about 6 years ago

could you with check recent trunk (2.5dev)? I'm not sure recent 2.4 has backport patch (r59063).

Updated by djellemah (John Anderson) about 6 years ago

I see r59063 went into ruby_2_4 yesterday.

I've been running the Pry rspec suite repeatedly with

ruby 2.5.0dev (2017-08-05 trunk 59519) [x86_64-linux]

ruby 2.4.2p181 (2017-08-05 revision 59520) [x86_64-linux]

and I don't get the crash.

Thanks :-)

Updated by ko1 (Koichi Sasada) about 6 years ago

  • Status changed from Open to Closed


Actions #11

Updated by usa (Usaku NAKAMURA) about 6 years ago

  • Backport changed from 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN to 2.2: DONTNEED, 2.3: DONTNEED, 2.4: DONE

Also available in: Atom PDF