Project

General

Profile

Actions

Bug #14361

closed

Segmentation fault when array includes two nil's without a comma between them: [nil nil, nil]

Added by khall (Kevin Hall) almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]
[ruby-core:84877]

Description

Easily reproduced segmentation fault relating to forgetting to type a comma between nil's in an array. Doesn't occur if array only contains the nil nil entry, instead throws a syntax error, which is what I would expect in this case.

Kevins-MacBook-Pro:mvp khall$ ruby -v
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]
Kevins-MacBook-Pro:mvp khall$ irb
2.5.0 :001 > [nil nil, nil]
/Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/workspace.rb:85: [BUG] Segmentation fault at 0x0000000000000020
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]

-- 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:0018 p:---- s:0093 e:000092 CFUNC :eval
c:0017 p:0021 s:0085 e:000084 METHOD /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/workspace.rb:85
c:0016 p:0021 s:0077 e:000075 METHOD /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/context.rb:380
c:0015 p:0017 s:0070 e:000069 BLOCK /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb.rb:491
c:0014 p:0025 s:0060 e:000059 METHOD /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb.rb:621
c:0013 p:0008 s:0054 e:000053 BLOCK /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb.rb:488
c:0012 p:0102 s:0049 e:000048 BLOCK /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/ruby-lex.rb:246 [FINISH]
c:0011 p:---- s:0045 e:000044 CFUNC :loop
c:0010 p:0006 s:0041 e:000040 BLOCK /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/ruby-lex.rb:232 [FINISH]
c:0009 p:---- s:0038 e:000037 CFUNC :catch
c:0008 p:0012 s:0033 e:000032 METHOD /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/ruby-lex.rb:231
c:0007 p:0029 s:0029 E:0011d0 METHOD /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb.rb:487
c:0006 p:0005 s:0025 e:000024 BLOCK /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb.rb:428 [FINISH]
c:0005 p:---- s:0022 e:000021 CFUNC :catch
c:0004 p:0063 s:0017 E:001338 METHOD /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb.rb:427
c:0003 p:0102 s:0012 e:000011 METHOD /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb.rb:383
c:0002 p:0019 s:0006 e:000005 EVAL /Users/khall/.rvm/rubies/ruby-2.5.0/bin/irb:11 [FINISH]
c:0001 p:0000 s:0003 E:002600 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
/Users/khall/.rvm/rubies/ruby-2.5.0/bin/irb:11:in <main>' /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb.rb:383:in start'
/Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb.rb:427:in run' /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb.rb:427:in catch'
/Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb.rb:428:in block in run' /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb.rb:487:in eval_input'
/Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/ruby-lex.rb:231:in each_top_level_statement' /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/ruby-lex.rb:231:in catch'
/Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/ruby-lex.rb:232:in block in each_top_level_statement' /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/ruby-lex.rb:232:in loop'
/Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/ruby-lex.rb:246:in block (2 levels) in each_top_level_statement' /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb.rb:488:in block in eval_input'
/Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb.rb:621:in signal_status' /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb.rb:491:in block (2 levels) in eval_input'
/Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/context.rb:380:in evaluate' /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/workspace.rb:85:in evaluate'
/Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/workspace.rb:85:in `eval'

-- Machine register context ------------------------------------------------
rax: 0x000000000000291b rbx: 0x00007fe0fd715170 rcx: 0x000000000000a91b
rdx: 0x0000000000000000 rdi: 0x00007fe0fd715170 rsi: 0x000000000000291b
rbp: 0x00007ffee3540570 rsp: 0x00007ffee353ef80 r8: 0x0000000000000000
r9: 0x000000000000004f r10: 0x00007ffee35403b8 r11: 0x000000000000005d
r12: 0x00007fe0fd744590 r13: 0x0000000000000000 r14: 0x00007fe0fd715140
r15: 0x00007fe0fd715140 rip: 0x000000010c7b12f1 rfl: 0x0000000000010206

-- C level backtrace information -------------------------------------------
0 libruby.2.5.dylib 0x000000010c8b0d47 rb_vm_bugreport + 135
1 libruby.2.5.dylib 0x000000010c7359b8 rb_bug_context + 472
2 libruby.2.5.dylib 0x000000010c825191 sigsegv + 81
3 libsystem_platform.dylib 0x00007fff770ecf5a _sigtramp + 26
4 libruby.2.5.dylib 0x000000010c7b12f1 ruby_yyparse + 12945
5 libruby.2.5.dylib 0x000000010c7c6a46 yycompile0 + 758
6 libruby.2.5.dylib 0x000000010c8b24f8 rb_suppress_tracing + 216
7 libruby.2.5.dylib 0x000000010c7c58f7 parser_compile_string + 183
8 libruby.2.5.dylib 0x000000010c77ef5c rb_iseq_compile_with_option + 348
9 libruby.2.5.dylib 0x000000010c8acc26 eval_string_with_cref + 614
10 libruby.2.5.dylib 0x000000010c89a7be rb_f_eval + 334
11 libruby.2.5.dylib 0x000000010c8a422b vm_call_cfunc + 283
12 libruby.2.5.dylib 0x000000010c88d984 vm_exec_core + 12196
13 libruby.2.5.dylib 0x000000010c89eafe vm_exec + 142
14 libruby.2.5.dylib 0x000000010c8ac224 invoke_block_from_c_bh + 372
15 libruby.2.5.dylib 0x000000010c8ad293 loop_i + 35
16 libruby.2.5.dylib 0x000000010c73fd07 rb_rescue2 + 311
17 libruby.2.5.dylib 0x000000010c8a422b vm_call_cfunc + 283
18 libruby.2.5.dylib 0x000000010c88cee4 vm_exec_core + 9476
19 libruby.2.5.dylib 0x000000010c89eafe vm_exec + 142
20 libruby.2.5.dylib 0x000000010c8ac224 invoke_block_from_c_bh + 372
21 libruby.2.5.dylib 0x000000010c8ad22e catch_i + 78
22 libruby.2.5.dylib 0x000000010c89b93d vm_catch_protect + 173
23 libruby.2.5.dylib 0x000000010c89bff2 rb_f_catch + 66
24 libruby.2.5.dylib 0x000000010c8a422b vm_call_cfunc + 283
25 libruby.2.5.dylib 0x000000010c88cee4 vm_exec_core + 9476
26 libruby.2.5.dylib 0x000000010c89eafe vm_exec + 142
27 libruby.2.5.dylib 0x000000010c8ac224 invoke_block_from_c_bh + 372
28 libruby.2.5.dylib 0x000000010c8ad22e catch_i + 78
29 libruby.2.5.dylib 0x000000010c89b93d vm_catch_protect + 173
30 libruby.2.5.dylib 0x000000010c89bff2 rb_f_catch + 66
31 libruby.2.5.dylib 0x000000010c8a422b vm_call_cfunc + 283
32 libruby.2.5.dylib 0x000000010c88cee4 vm_exec_core + 9476
33 libruby.2.5.dylib 0x000000010c89eafe vm_exec + 142
34 libruby.2.5.dylib 0x000000010c73f531 ruby_exec_internal + 177
35 libruby.2.5.dylib 0x000000010c73f428 ruby_run_node + 56
36 ruby 0x000000010c6bdf2f main + 79

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

  • Loaded script: irb

  • Loaded features:

    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
    4 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/x86_64-darwin17/enc/encdb.bundle
    5 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/x86_64-darwin17/enc/trans/transdb.bundle
    6 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/x86_64-darwin17/rbconfig.rb
    7 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems/compatibility.rb
    8 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems/defaults.rb
    9 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems/deprecate.rb
    10 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems/errors.rb
    11 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems/version.rb
    12 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems/requirement.rb
    13 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems/platform.rb
    14 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems/basic_specification.rb
    15 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems/stub_specification.rb
    16 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems/util/list.rb
    17 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/x86_64-darwin17/stringio.bundle
    18 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems/specification.rb
    19 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems/exceptions.rb
    20 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems/dependency.rb
    21 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems/core_ext/kernel_gem.rb
    22 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/monitor.rb
    23 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb
    24 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems.rb
    25 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems/path_support.rb
    26 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/did_you_mean-1.2.0/lib/did_you_mean/version.rb
    27 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/did_you_mean-1.2.0/lib/did_you_mean/core_ext/name_error.rb
    28 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/did_you_mean-1.2.0/lib/did_you_mean/levenshtein.rb
    29 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/did_you_mean-1.2.0/lib/did_you_mean/jaro_winkler.rb
    30 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/did_you_mean-1.2.0/lib/did_you_mean/spell_checker.rb
    31 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/delegate.rb
    32 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/did_you_mean-1.2.0/lib/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb
    33 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/did_you_mean-1.2.0/lib/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb
    34 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/did_you_mean-1.2.0/lib/did_you_mean/spell_checkers/name_error_checkers.rb
    35 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/did_you_mean-1.2.0/lib/did_you_mean/spell_checkers/method_name_checker.rb
    36 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/did_you_mean-1.2.0/lib/did_you_mean/spell_checkers/key_error_checker.rb
    37 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/did_you_mean-1.2.0/lib/did_you_mean/spell_checkers/null_checker.rb
    38 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/did_you_mean-1.2.0/lib/did_you_mean/formatters/plain_formatter.rb
    39 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/did_you_mean-1.2.0/lib/did_you_mean.rb
    40 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/e2mmap.rb
    41 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/init.rb
    42 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/workspace.rb
    43 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/inspector.rb
    44 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/output-method.rb
    45 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/context.rb
    46 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/extend-command.rb
    47 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/notifier.rb
    48 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/slex.rb
    49 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/ruby-token.rb
    50 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/ruby-lex.rb
    51 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/src_encoding.rb
    52 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/magic-file.rb
    53 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/x86_64-darwin17/readline.bundle
    54 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/input-method.rb
    55 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/locale.rb
    56 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb.rb
    57 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems/bundler_version_finder.rb
    58 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems/util.rb
    59 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/completion.rb
    60 /Users/khall/.rvm/scripts/irbrc.rb
    61 /Users/khall/.rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/irb/ext/save-history.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


Files

ruby_2018-01-15-093218_Kevins-MacBook-Pro.crash (38.6 KB) ruby_2018-01-15-093218_Kevins-MacBook-Pro.crash crash report khall (Kevin Hall), 01/15/2018 05:38 PM
seg_fault.rb (15 Bytes) seg_fault.rb script to reproduce khall (Kevin Hall), 01/15/2018 05:41 PM
14361_segv.txt (3 KB) 14361_segv.txt MSP-Greg (Greg L), 01/16/2018 04:50 PM

Related issues 1 (0 open1 closed)

Is duplicate of Ruby master - Bug #14261: invalid syntax segfaults: "x, true"ClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0