Project

General

Profile

Actions

Bug #12531

closed

Segmentation fault occurred when execute curry with block

Added by eccyan (Daisuke Sato) over 7 years ago. Updated over 7 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.4.0dev (2016-06-28 trunk 55527) [x86_64-darwin15]
[ruby-dev:49695]

Description

When I execute code below:

$ ./ruby -e '-> { true }.curry.call(&:to_s)'

I create a patch for fix and test. I hope for your help :)

And logs:

[trunk][~/devel/ruby]$ ./ruby -e 'proc { true }.curry.call(&:to_s)'                                                                                           rbenv:2.4.0-preview1
-e:1: [BUG] Segmentation fault at 0x000000000ce12c
ruby 2.4.0dev (2016-06-28 trunk 55527) [x86_64-darwin15]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:
     * ~/Library/Logs/CrashReporter
     * /Library/Logs/CrashReporter
     * ~/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:0003 p:---- s:0006 e:000005 IFUNC
c:0002 p:0016 s:0004 E:001160 EVAL   -e:1 [FINISH]
c:0001 p:0000 s:0002 E:001380 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
-e:1:in `<main>'

-- Machine register context ------------------------------------------------
 rax: 0x00000000000ce10c rbx: 0x000000010d292020 rcx: 0x00007fb4215a9190
 rdx: 0x00007fb4228be5e8 rdi: 0x00000000000ce10c rsi: 0x0000000000000000
 rbp: 0x00007fff52fd1b40 rsp: 0x00007fff52fd1b40  r8: 0x00007fb4228be5d8
  r9: 0x0000000000000000 r10: 0x00007fb4214071b0 r11: 0x000000010d292000
 r12: 0x0000000000000000 r13: 0x0000000000000000 r14: 0x0000000000000000
 r15: 0x0000000000000000 rip: 0x000000010cd7a027 rfl: 0x0000000000010202

-- C level backtrace information -------------------------------------------
0   ruby                                0x000000010ce9eaa9 rb_print_backtrace + 25
1   ruby                                0x000000010ce9ebbd rb_vm_bugreport + 141
2   ruby                                0x000000010ccaea84 rb_bug_context + 452
3   ruby                                0x000000010cdec6fb sigsegv + 91
4   libsystem_platform.dylib            0x00007fff8b53c52a _sigtramp + 26
5   ruby                                0x000000010cd7a027 passed_block + 23
6   ???                                 0x00007fff52fd1bc0 0x0 + 140734585707456

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

* Loaded script: -e

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
    4 /usr/local/lib/ruby/2.4.0/x86_64-darwin15/enc/encdb.bundle
    5 /usr/local/lib/ruby/2.4.0/x86_64-darwin15/enc/trans/transdb.bundle
    6 /usr/local/lib/ruby/2.4.0/unicode_normalize.rb
    7 /usr/local/lib/ruby/2.4.0/x86_64-darwin15/rbconfig.rb
    8 /usr/local/lib/ruby/2.4.0/rubygems/compatibility.rb
    9 /usr/local/lib/ruby/2.4.0/rubygems/defaults.rb
   10 /usr/local/lib/ruby/2.4.0/rubygems/deprecate.rb
   11 /usr/local/lib/ruby/2.4.0/rubygems/errors.rb
   12 /usr/local/lib/ruby/2.4.0/rubygems/version.rb
   13 /usr/local/lib/ruby/2.4.0/rubygems/requirement.rb
   14 /usr/local/lib/ruby/2.4.0/rubygems/platform.rb
   15 /usr/local/lib/ruby/2.4.0/rubygems/basic_specification.rb
   16 /usr/local/lib/ruby/2.4.0/rubygems/stub_specification.rb
   17 /usr/local/lib/ruby/2.4.0/rubygems/util/list.rb
   18 /usr/local/lib/ruby/2.4.0/x86_64-darwin15/stringio.bundle
   19 /usr/local/lib/ruby/2.4.0/rubygems/specification.rb
   20 /usr/local/lib/ruby/2.4.0/rubygems/exceptions.rb
   21 /usr/local/lib/ruby/2.4.0/rubygems/dependency.rb
   22 /usr/local/lib/ruby/2.4.0/rubygems/core_ext/kernel_gem.rb
   23 /usr/local/lib/ruby/2.4.0/monitor.rb
   24 /usr/local/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb
   25 /usr/local/lib/ruby/2.4.0/rubygems.rb
   26 /usr/local/lib/ruby/2.4.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

[1]    66954 abort      ./ruby -e 'proc { true }.curry.call(&:to_s)'

Files

DiagnosticReports.crash (12.7 KB) DiagnosticReports.crash under ~/Library/Logs/DiagnosticReports/ eccyan (Daisuke Sato), 06/28/2016 09:41 PM
fix_curry_with_block.patch (1.18 KB) fix_curry_with_block.patch a patch for segmentation fault eccyan (Daisuke Sato), 06/28/2016 09:56 PM
Actions #2

Updated by eccyan (Daisuke Sato) over 7 years ago

  • File deleted (fix_curry_with_block.patch)
Actions #3

Updated by nobu (Nobuyoshi Nakada) over 7 years ago

  • Status changed from Open to Closed

Applied in changeset r55531.


Passed block symbol to proc

  • proc.c (passed_block): convert passed block symbol to proc.
    based on the patch by Daisuke Sato in [ruby-dev:49695].
    [Bug #12531]

Updated by nagachika (Tomoyuki Chikanaga) over 7 years ago

  • Backport changed from 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN to 2.1: DONTNEED, 2.2: DONTNEED, 2.3: REQUIRED

Updated by nagachika (Tomoyuki Chikanaga) over 7 years ago

  • Backport changed from 2.1: DONTNEED, 2.2: DONTNEED, 2.3: REQUIRED to 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONE

ruby_2_3 r55778 merged revision(s) 54909,55531.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0