Project

General

Profile

Actions

Bug #19032

closed

Assertion Failed: vm_insnhelper.c:1176:vm_getivar:rb_ractor_shareable_p(obj) ? rb_ractor_shareable_p(val) : true

Added by byroot (Jean Boussier) 2 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 3.2.0dev (2022-09-28T20:44:14Z master e7ddb6b182) [x86_64-linux]
[ruby-core:110150]

Description

I got 10 occurrences of an assertion failure on our nightly CI. Yesterday's build (b8e804e410) was fine, so I suspect the problem was introduced yesterday?

If that assumption is correct the bug would have been introduced in one of these 27 commits https://github.com/ruby/ruby/compare/b8e804e410...e7ddb6b182.

Assertion Failed: vm_insnhelper.c:1176:vm_getivar:rb_ractor_shareable_p(obj) ? rb_ractor_shareable_p(val) : true
ruby 3.2.0dev (2022-09-28T20:44:14Z master e7ddb6b182) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0053 p:0011 s:0256 e:000255 METHOD /tmp/bundle/ruby/3.2.0+2/gems/mocha-1.14.0/lib/mocha/object_methods.rb:17
c:0052 p:0005 s:0251 e:000250 METHOD /tmp/bundle/ruby/3.2.0+2/gems/mocha-1.14.0/lib/mocha/stubbed_method.rb:31
c:0051 p:0011 s:0247 e:000246 METHOD /tmp/bundle/ruby/3.2.0+2/gems/mocha-1.14.0/lib/mocha/stubbed_method.rb:25
c:0050 p:0017 s:0243 e:000242 METHOD /tmp/bundle/ruby/3.2.0+2/gems/mocha-1.14.0/lib/mocha/central.rb:32
c:0049 p:0014 s:0237 e:000236 METHOD /tmp/bundle/ruby/3.2.0+2/gems/mocha-1.14.0/lib/mocha/central.rb:38
c:0048 p:0005 s:0233 e:000232 METHOD /tmp/bundle/ruby/3.2.0+2/gems/mocha-1.14.0/lib/mocha/mockery.rb:96
c:0047 p:0005 s:0229 e:000228 METHOD /tmp/bundle/ruby/3.2.0+2/gems/mocha-1.14.0/lib/mocha/mockery.rb:53
c:0046 p:0004 s:0225 e:000224 METHOD /tmp/bundle/ruby/3.2.0+2/gems/mocha-1.14.0/lib/mocha/hooks.rb:39
c:0045 p:0008 s:0221 e:000220 METHOD /tmp/bundle/ruby/3.2.0+2/gems/mocha-1.14.0/lib/mocha/integration/mini_test/adapter.rb:47
c:0044 p:0008 s:0217 e:000216 METHOD /tmp/bundle/ruby/3.2.0+2/bundler/gems/rails-b7eaebe5a7da/activesupport/lib/active_support/testing/time_helpers.rb:72
c:0043 p:0008 s:0213 e:000212 METHOD /app/components/shop_identity/test/support/helpers/test_macros/feature_set_cache_helper.rb:37
c:0042 p:0008 s:0209 e:000208 METHOD /app/components/taxes/test/support/helpers/taxes/country_rate_cache_test_helper.rb:36
c:0041 p:0004 s:0205 e:000204 METHOD /tmp/bundle/ruby/3.2.0+2/bundler/gems/rails-b7eaebe5a7da/activerecord/lib/active_record/test_fixtures.rb:15
c:0040 p:0004 s:0201 e:000200 METHOD /tmp/bundle/ruby/3.2.0+2/bundler/gems/rails-b7eaebe5a7da/activejob/lib/active_job/test_helper.rb:52
c:0039 p:0008 s:0197 e:000196 METHOD /app/components/platform/test/support/helpers/test_macros/feature_rollout_cache_helper.rb:37
c:0038 p:0008 s:0193 e:000192 METHOD /app/components/platform/test/support/helpers/test_macros/memcached_helper.rb:54
c:0037 p:0008 s:0189 e:000188 METHOD /app/components/platform/test/support/helpers/test_macros/redis_helper.rb:425
c:0036 p:0011 s:0185 e:000184 METHOD /tmp/bundle/ruby/3.2.0+2/bundler/gems/rails-b7eaebe5a7da/activesupport/lib/active_support/testing/setup_and_teardown.rb:51
c:0035 p:0005 s:0180 e:000179 BLOCK  /tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest/test.rb:103
c:0034 p:0002 s:0177 e:000176 METHOD /tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest/test.rb:195
c:0033 p:0004 s:0172 e:000171 BLOCK  /tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest/test.rb:102 [FINISH]
c:0032 p:---- s:0168 e:000167 CFUNC  :each
c:0031 p:0010 s:0164 e:000163 BLOCK  /tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest/test.rb:101
c:0030 p:0008 s:0161 e:000160 METHOD /tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest.rb:296
c:0029 p:0004 s:0156 e:000155 BLOCK  /tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest/test.rb:94
c:0028 p:0022 s:0153 e:000152 METHOD /tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest.rb:391
c:0027 p:0027 s:0145 E:0021e8 METHOD /tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest/test.rb:243
c:0026 p:0004 s:0138 E:002340 METHOD /tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest/test.rb:93
c:0025 p:0040 s:0134 e:000133 METHOD /tmp/bundle/ruby/3.2.0+2/gems/minitest-reporters-1.3.8/lib/minitest/reporters.rb:48
c:0024 p:0008 s:0127 e:000126 BLOCK  /tmp/bundle/ruby/3.2.0+2/bundler/gems/rails-b7eaebe5a7da/activesupport/lib/active_support/executor/test_helper.rb:5
c:0023 p:0012 s:0124 e:000123 METHOD /tmp/bundle/ruby/3.2.0+2/bundler/gems/rails-b7eaebe5a7da/activesupport/lib/active_support/execution_wrapper.rb:105
c:0022 p:0009 s:0119 e:000118 METHOD /tmp/bundle/ruby/3.2.0+2/bundler/gems/rails-b7eaebe5a7da/activesupport/lib/active_support/executor/test_helper.rb:5
c:0021 p:0009 s:0113 e:000112 BLOCK  /app/components/platform/test/support/helpers/timeout_test_helper.rb:102
c:0020 p:0027 s:0110 e:000109 BLOCK  /usr/local/ruby/lib/ruby/3.2.0+2/timeout.rb:189
c:0019 p:0004 s:0105 e:000104 BLOCK  /usr/local/ruby/lib/ruby/3.2.0+2/timeout.rb:36 [FINISH]
c:0018 p:---- s:0102 e:000101 CFUNC  :catch
c:0017 p:0036 s:0097 e:000096 METHOD /usr/local/ruby/lib/ruby/3.2.0+2/timeout.rb:36
c:0016 p:0107 s:0091 E:001b68 METHOD /usr/local/ruby/lib/ruby/3.2.0+2/timeout.rb:198
c:0015 p:0008 s:0080 E:002130 BLOCK  /app/components/platform/test/support/helpers/timeout_test_helper.rb:101
c:0014 p:0010 s:0077 e:000076 METHOD /usr/local/ruby/lib/ruby/3.2.0+2/benchmark.rb:311
c:0013 p:0047 s:0072 E:0024a8 METHOD /app/components/platform/test/support/helpers/timeout_test_helper.rb:95
c:0012 p:0023 s:0063 e:000062 METHOD /app/components/platform/test/support/helpers/mutation_test_helper.rb:19
c:0011 p:0008 s:0058 e:000057 METHOD /tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest.rb:1059
c:0010 p:0010 s:0051 e:000050 BLOCK  /tmp/bundle/ruby/3.2.0+2/gems/ci-queue-0.24.2/lib/minitest/queue.rb:179
c:0009 p:0007 s:0048 e:000047 METHOD /tmp/bundle/ruby/3.2.0+2/gems/ci-queue-0.24.2/lib/minitest/queue.rb:168
c:0008 p:0004 s:0042 e:000041 METHOD /tmp/bundle/ruby/3.2.0+2/gems/ci-queue-0.24.2/lib/minitest/queue.rb:178
c:0007 p:0005 s:0038 e:000037 BLOCK  /tmp/bundle/ruby/3.2.0+2/gems/ci-queue-0.24.2/lib/minitest/queue.rb:229
c:0006 p:0027 s:0031 e:000030 METHOD /tmp/bundle/ruby/3.2.0+2/gems/ci-queue-0.24.2/lib/ci/queue/redis/worker.rb:51
c:0005 p:0006 s:0026 e:000025 METHOD /tmp/bundle/ruby/3.2.0+2/gems/ci-queue-0.24.2/lib/minitest/queue.rb:228
c:0004 p:0012 s:0020 e:000019 METHOD /tmp/bundle/ruby/3.2.0+2/gems/ci-queue-0.24.2/lib/minitest/queue.rb:213
c:0003 p:0133 s:0015 e:000014 METHOD /tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest.rb:159
c:0002 p:0045 s:0008 E:002200 BLOCK  /tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest.rb:83 [FINISH]
c:0001 p:0000 s:0003 E:000580 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
/tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest.rb:83:in `block in autorun'
/tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest.rb:159:in `run'
/tmp/bundle/ruby/3.2.0+2/gems/ci-queue-0.24.2/lib/minitest/queue.rb:213:in `__run'
/tmp/bundle/ruby/3.2.0+2/gems/ci-queue-0.24.2/lib/minitest/queue.rb:228:in `run_from_queue'
/tmp/bundle/ruby/3.2.0+2/gems/ci-queue-0.24.2/lib/ci/queue/redis/worker.rb:51:in `poll'
/tmp/bundle/ruby/3.2.0+2/gems/ci-queue-0.24.2/lib/minitest/queue.rb:229:in `block in run_from_queue'
/tmp/bundle/ruby/3.2.0+2/gems/ci-queue-0.24.2/lib/minitest/queue.rb:178:in `run'
/tmp/bundle/ruby/3.2.0+2/gems/ci-queue-0.24.2/lib/minitest/queue.rb:168:in `with_timestamps'
/tmp/bundle/ruby/3.2.0+2/gems/ci-queue-0.24.2/lib/minitest/queue.rb:179:in `block in run'
/tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest.rb:1059:in `run_one_method'
/app/components/platform/test/support/helpers/mutation_test_helper.rb:19:in `run'
/app/components/platform/test/support/helpers/timeout_test_helper.rb:95:in `run'
/usr/local/ruby/lib/ruby/3.2.0+2/benchmark.rb:311:in `realtime'
/app/components/platform/test/support/helpers/timeout_test_helper.rb:101:in `block in run'
/usr/local/ruby/lib/ruby/3.2.0+2/timeout.rb:198:in `timeout'
/usr/local/ruby/lib/ruby/3.2.0+2/timeout.rb:36:in `catch'
/usr/local/ruby/lib/ruby/3.2.0+2/timeout.rb:36:in `catch'
/usr/local/ruby/lib/ruby/3.2.0+2/timeout.rb:36:in `block in catch'
/usr/local/ruby/lib/ruby/3.2.0+2/timeout.rb:189:in `block in timeout'
/app/components/platform/test/support/helpers/timeout_test_helper.rb:102:in `block (2 levels) in run'
/tmp/bundle/ruby/3.2.0+2/bundler/gems/rails-b7eaebe5a7da/activesupport/lib/active_support/executor/test_helper.rb:5:in `run'
/tmp/bundle/ruby/3.2.0+2/bundler/gems/rails-b7eaebe5a7da/activesupport/lib/active_support/execution_wrapper.rb:105:in `perform'
/tmp/bundle/ruby/3.2.0+2/bundler/gems/rails-b7eaebe5a7da/activesupport/lib/active_support/executor/test_helper.rb:5:in `block in run'
/tmp/bundle/ruby/3.2.0+2/gems/minitest-reporters-1.3.8/lib/minitest/reporters.rb:48:in `run_with_hooks'
/tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest/test.rb:93:in `run'
/tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest/test.rb:243:in `with_info_handler'
/tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest.rb:391:in `on_signal'
/tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest/test.rb:94:in `block in run'
/tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest.rb:296:in `time_it'
/tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest/test.rb:101:in `block (2 levels) in run'
/tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest/test.rb:101:in `each'
/tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest/test.rb:102:in `block (3 levels) in run'
/tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest/test.rb:195:in `capture_exceptions'
/tmp/bundle/ruby/3.2.0+2/gems/minitest-5.16.3/lib/minitest/test.rb:103:in `block (4 levels) in run'
/tmp/bundle/ruby/3.2.0+2/bundler/gems/rails-b7eaebe5a7da/activesupport/lib/active_support/testing/setup_and_teardown.rb:51:in `after_teardown'
/app/components/platform/test/support/helpers/test_macros/redis_helper.rb:425:in `after_teardown'
/app/components/platform/test/support/helpers/test_macros/memcached_helper.rb:54:in `after_teardown'
/app/components/platform/test/support/helpers/test_macros/feature_rollout_cache_helper.rb:37:in `after_teardown'
/tmp/bundle/ruby/3.2.0+2/bundler/gems/rails-b7eaebe5a7da/activejob/lib/active_job/test_helper.rb:52:in `after_teardown'
/tmp/bundle/ruby/3.2.0+2/bundler/gems/rails-b7eaebe5a7da/activerecord/lib/active_record/test_fixtures.rb:15:in `after_teardown'
/app/components/taxes/test/support/helpers/taxes/country_rate_cache_test_helper.rb:36:in `after_teardown'
/app/components/shop_identity/test/support/helpers/test_macros/feature_set_cache_helper.rb:37:in `after_teardown'
/tmp/bundle/ruby/3.2.0+2/bundler/gems/rails-b7eaebe5a7da/activesupport/lib/active_support/testing/time_helpers.rb:72:in `after_teardown'
/tmp/bundle/ruby/3.2.0+2/gems/mocha-1.14.0/lib/mocha/integration/mini_test/adapter.rb:47:in `after_teardown'
/tmp/bundle/ruby/3.2.0+2/gems/mocha-1.14.0/lib/mocha/hooks.rb:39:in `mocha_teardown'
/tmp/bundle/ruby/3.2.0+2/gems/mocha-1.14.0/lib/mocha/mockery.rb:53:in `teardown'
/tmp/bundle/ruby/3.2.0+2/gems/mocha-1.14.0/lib/mocha/mockery.rb:96:in `teardown'
/tmp/bundle/ruby/3.2.0+2/gems/mocha-1.14.0/lib/mocha/central.rb:38:in `unstub_all'
/tmp/bundle/ruby/3.2.0+2/gems/mocha-1.14.0/lib/mocha/central.rb:32:in `unstub'
/tmp/bundle/ruby/3.2.0+2/gems/mocha-1.14.0/lib/mocha/stubbed_method.rb:25:in `unstub'
/tmp/bundle/ruby/3.2.0+2/gems/mocha-1.14.0/lib/mocha/stubbed_method.rb:31:in `mock'
/tmp/bundle/ruby/3.2.0+2/gems/mocha-1.14.0/lib/mocha/object_methods.rb:17:in `mocha'

-- C level backtrace information -------------------------------------------
/usr/local/ruby/bin/ruby(rb_print_backtrace+0x11) [0x55dc918b7ab8] vm_dump.c:762
/usr/local/ruby/bin/ruby(rb_vm_bugreport) vm_dump.c:1057
/usr/local/ruby/bin/ruby(rb_assert_failure+0x77) [0x55dc916e0800] error.c:883
/usr/local/ruby/bin/ruby(vm_getspecial+0x0) [0x55dc916d7a26] vm_insnhelper.c:1176
/usr/local/ruby/bin/ruby(vm_getspecial) vm_insnhelper.c:612
/usr/local/ruby/bin/ruby(vm_exec_core) insns.def:194
/usr/local/ruby/bin/ruby(rb_vm_exec+0xbc) [0x55dc9189840c] vm.c:2398
/usr/local/ruby/bin/ruby(rb_yield+0x3f9) [0x55dc918ad719] vm.c:1417
/usr/local/ruby/bin/ruby(rb_ary_each+0x70) [0x55dc918c7710] array.c:2729
/usr/local/ruby/bin/ruby(vm_call_cfunc_with_frame+0x10c) [0x55dc91895ecc] vm_insnhelper.c:3211
/usr/local/ruby/bin/ruby(vm_sendish+0x104) [0x55dc918a05c4] vm_insnhelper.c:5021
/usr/local/ruby/bin/ruby(vm_exec_core) insns.def:801
/usr/local/ruby/bin/ruby(rb_vm_exec+0xbc) [0x55dc9189840c] vm.c:2398
/usr/local/ruby/bin/ruby(catch_i+0x240) [0x55dc918ac8e0] vm.c:1417
/usr/local/ruby/bin/ruby(vm_catch_protect+0x107) [0x55dc918972a7] vm_eval.c:2390
/usr/local/ruby/bin/ruby(rb_catch_obj+0x28) [0x55dc9189753d] vm_eval.c:2416
/usr/local/ruby/bin/ruby(rb_f_catch) vm_eval.c:2366
/usr/local/ruby/bin/ruby(vm_call_cfunc_with_frame+0x10c) [0x55dc91895ecc] vm_insnhelper.c:3211
/usr/local/ruby/bin/ruby(vm_call_method_each_type+0x7d) [0x55dc918a977d] vm_insnhelper.c:3864
/usr/local/ruby/bin/ruby(vm_call_method+0x127) [0x55dc918aa297] vm_insnhelper.c:4016
/usr/local/ruby/bin/ruby(vm_sendish+0x104) [0x55dc918a05c4] vm_insnhelper.c:5021
/usr/local/ruby/bin/ruby(vm_exec_core) insns.def:801
/usr/local/ruby/bin/ruby(rb_vm_exec+0xbc) [0x55dc9189840c] vm.c:2398
/usr/local/ruby/bin/ruby(rb_vm_invoke_proc+0x6f) [0x55dc91899a0f] vm.c:1622
/usr/local/ruby/bin/ruby(rb_proc_call_kw+0xad) [0x55dc917aa64d] proc.c:991
/usr/local/ruby/bin/ruby(exec_end_procs_chain+0x44) [0x55dc916e603d] eval_jump.c:105
/usr/local/ruby/bin/ruby(rb_ec_exec_end_proc) eval_jump.c:120
/usr/local/ruby/bin/ruby(rb_ec_teardown+0xdd) [0x55dc916e623d] eval.c:155
/usr/local/ruby/bin/ruby(rb_ec_cleanup+0x184) [0x55dc916e6484] eval.c:205
/usr/local/ruby/bin/ruby(ruby_run_node+0x62) [0x55dc916e6ea2] eval.c:321
/usr/local/ruby/bin/ruby(rb_main+0x21) [0x55dc916e0e57] ./main.c:38
/usr/local/ruby/bin/ruby(main) ./main.c:57
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f59b6c3d083]
[0x55dc916e0eae]

Updated by byroot (Jean Boussier) 2 months ago

I just realized this is likely to be shape related (https://github.com/ruby/ruby/commit/d594a5a8bd0756f65c078fcf5ce0098250cba141). I notified Jemma.

Actions #2

Updated by mame (Yusuke Endoh) 2 months ago

@byroot (Jean Boussier) Object Shapes has been reverted. Is this problem still happening?

Actions #3

Updated by byroot (Jean Boussier) 2 months ago

  • Status changed from Open to Closed

@mame (Yusuke Endoh) It's fixed indeed.

A few information we figured when debugging this with @jemmai (Jemma Issroff):

  • This only happen in DEBUG mode (kinda implied since it's an assertion failure)
  • We found a small reproduction script for it:
class Example
  def initialize
    self
  end
end

class Object
  def method
    unless @var
      @var = Example.new
    end

    @var
  end
end

ENV.method
ENV.method

I assume Jemma will be fixing this from a branch, so we can close.

Updated by jemmai (Jemma Issroff) 2 months ago

Yes, this bug was because the assertion had previously only applied to T_OBJECTs, but when we merged shapes initially, we applied it to all data types. That's why the example above (on ENV, which has type T_DATA) was failing on the assertion. I fixed it in this PR, and when we merge shapes again, I will ensure the fix is still there.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0