Issue #13832 has been updated by mrkn (Kenta Murata).


I can reproduce this bug with r59639.

----------------------------------------
Bug #13832: cfp consistency error occurred in vm_call_cfunc on non-optimized ruby
https://bugs.ruby-lang.org/issues/13832#change-66254

* Author: mrkn (Kenta Murata)
* Status: Feedback
* Priority: Normal
* Assignee: 
* Target version: 2.5
* ruby -v: 
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
The following script occurs `[BUG] vm_call_cfunc: cfp consistency error` on ruby that is compiled with `-O0`.

```console
$ cat test.rb
def callback
  p :callback
  @non_existing_ivar
end

ObjectSpace.define_finalizer(Object.new, &method(:callback))
GC.start
$ RBENV_VERSION=trunk-o0 ruby -v test.rb
ruby 2.5.0dev (2017-08-20 trunk 58053) [x86_64-darwin16]
test.rb:7: [BUG] vm_call_cfunc: cfp consistency error (0x0000000108988fa0, 0x0000000108988f70)
ruby 2.5.0dev (2017-08-20 trunk 58053) [x86_64-darwin16]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   for more details.
Don't forget to include the above Crash Report log file in bug reports.

-- Control frame information -----------------------------------------------
c:0004 p:---- s:0015 e:000012 IFUNC
c:0003 p:---- s:0010 e:000009 CFUNC  :start
c:0002 p:0054 s:0006 e:000005 EVAL   test.rb:7 [FINISH]
c:0001 p:0000 s:0003 E:001980 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
test.rb:7:in `<main>'
test.rb:7:in `start'

-- C level backtrace information -------------------------------------------
0   libruby.2.5.0.dylib                 0x0000000108637cb9 rb_print_backtrace + 25
1   libruby.2.5.0.dylib                 0x0000000108637dc8 rb_vm_bugreport + 136
2   libruby.2.5.0.dylib                 0x0000000108437d8f rb_bug + 479
3   libruby.2.5.0.dylib                 0x0000000108622c25 vm_call_cfunc_with_frame + 693
4   libruby.2.5.0.dylib                 0x000000010861e19a vm_call_cfunc + 170
5   libruby.2.5.0.dylib                 0x000000010861d67a vm_call_method_each_type + 186
6   libruby.2.5.0.dylib                 0x000000010861d410 vm_call_method + 160
7   libruby.2.5.0.dylib                 0x000000010861d365 vm_call_general + 53
8   libruby.2.5.0.dylib                 0x0000000108609bd3 vm_exec_core + 8163
9   libruby.2.5.0.dylib                 0x0000000108618ce6 vm_exec + 182
10  libruby.2.5.0.dylib                 0x0000000108619a3d rb_iseq_eval_main + 45
11  libruby.2.5.0.dylib                 0x00000001084420b9 ruby_exec_internal + 233
12  libruby.2.5.0.dylib                 0x0000000108441fc1 ruby_exec_node + 33
13  libruby.2.5.0.dylib                 0x0000000108441f80 ruby_run_node + 64
14  ruby                                0x00000001083a5f11 main + 113

-- Other runtime information -----------------------------------------------

* Loaded script: test.rb

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
    4 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/x86_64-darwin16/enc/encdb.bundle
    5 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/x86_64-darwin16/enc/trans/transdb.bundle
    6 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/x86_64-darwin16/rbconfig.rb
    7 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/rubygems/compatibility.rb
    8 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/rubygems/defaults.rb
    9 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/rubygems/deprecate.rb
   10 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/rubygems/errors.rb
   11 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/rubygems/version.rb
   12 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/rubygems/requirement.rb
   13 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/rubygems/platform.rb
   14 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/rubygems/basic_specification.rb
   15 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/rubygems/stub_specification.rb
   16 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/rubygems/util/list.rb
   17 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/x86_64-darwin16/stringio.bundle
   18 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/rubygems/specification.rb
   19 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/rubygems/exceptions.rb
   20 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/rubygems/dependency.rb
   21 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/rubygems/core_ext/kernel_gem.rb
   22 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/monitor.rb
   23 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb
   24 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/rubygems.rb
   25 /Users/mrkn/.rbenv/versions/trunk-o0/lib/ruby/2.5.0/rubygems/path_support.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

[IMPORTANT]
Don't forget to include the Crash Report log file under
DiagnosticReports directory in bug reports.

Abort trap: 6
```

This also occurs on non-optimized ruby 2.4.1.


---Files--------------------------------
ruby_2017-08-21-124245_mrkn-mbp15-late2016.crash (11.7 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>