Project

General

Profile

Bug #13832

cfp consistency error occurred in vm_call_cfunc on non-optimized ruby

Added by mrkn (Kenta Murata) almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
[ruby-core:82432]

Description

The following script occurs [BUG] vm_call_cfunc: cfp consistency error on ruby that is compiled with -O0.

$ 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

#1

Updated by mrkn (Kenta Murata) almost 3 years ago

  • Description updated (diff)

Updated by nobu (Nobuyoshi Nakada) almost 3 years ago

  • Status changed from Open to Feedback

Seems something weird, r58053 is for 2.4.1 at 2017-03-22.
And I can't reproduce it with r59639.
Try checkout and make up again.

Updated by mrkn (Kenta Murata) almost 3 years ago

I can reproduce this bug with r59639.

Updated by mrkn (Kenta Murata) almost 3 years ago

This is my configure options:

~/src/github.com/ruby/ruby/configure \
  --prefix=$(echo ~/.rbenv/versions/trunk-o0) \
  --with-opt-dir=$(brew --prefix) \
  --with-dbm-dir=$(brew --prefix qdbm) \
  --with-dbm-type=qdbm \
  --with-gdbm-dir=$(brew --prefix gdbm) \
  --with-libyaml-dir=$(brew --prefix libyaml) \
  --with-openssl-dir=$(brew --prefix openssl) \
  --with-readline-dir=$(brew --prefix readline) \
  --disable-install-doc \
  --enable-shared \
  --enable-dtrace \
  optflags="-O0 -mtune=native -march=native" \
  debugflags="-g"
#5

Updated by nobu (Nobuyoshi Nakada) almost 3 years ago

  • Status changed from Feedback to Closed

Applied in changeset trunk|r59649.


gc.c: restore cfp at finalizer

  • gc.c (run_finalizer): restore cfp for the case an exception raised in a finalizer. [ruby-core:82432] [Bug #13832]
#6

Updated by nagachika (Tomoyuki Chikanaga) almost 3 years ago

  • Backport changed from 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN to 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: REQUIRED
#7

Updated by nagachika (Tomoyuki Chikanaga) almost 3 years ago

  • Backport changed from 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: REQUIRED to 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: DONE
#8

Updated by usa (Usaku NAKAMURA) almost 3 years ago

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

Also available in: Atom PDF