Project

General

Profile

Bug #15962

irb immediately crashes when you type <<' or <<"

Added by hasumikin (hitoshi hasumi) 5 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.7.0dev (2019-06-26T23:23:11Z trunk 7172ab0ec5) [x86_64-linux]
[ruby-core:93379]

Description

irb crashes right after inputting <<' or <<" from the top of a line.

The crash happens without inputting Enter key.

This is the log:

irb(main):001:0* <<Traceback (most recent call last):
        35: from /home/hasumi/opt/ruby-head/bin/irb-head:23:in `<main>'
        34: from /home/hasumi/opt/ruby-head/bin/irb-head:23:in `load'
        33: from /home/hasumi/opt/ruby-head/lib/ruby/gems/2.7.0/gems/irb-1.1.0.pre.1/exe/irb:11:in `<top (required)>'
        32: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/irb.rb:389:in `start'
        31: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/irb.rb:431:in `run'
        30: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/irb.rb:431:in `catch'
        29: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/irb.rb:432:in `block in run'
        28: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/irb.rb:496:in `eval_input'
        27: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/irb/ruby-lex.rb:125:in `each_top_level_statement'
        26: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/irb/ruby-lex.rb:125:in `catch'
        25: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/irb/ruby-lex.rb:126:in `block in each_top_level_statement'
        24: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/irb/ruby-lex.rb:126:in `loop'
        23: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/irb/ruby-lex.rb:129:in `block (2 levels) in each_top_level_statement'
        22: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/irb/ruby-lex.rb:157:in `lex'
        21: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/irb.rb:477:in `block in eval_input'
        20: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/irb.rb:654:in `signal_status'
        19: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/irb.rb:478:in `block (2 levels) in eval_input'
        18: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/irb/input-method.rb:259:in `gets'
        17: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/reline.rb:296:in `readmultiline'
        16: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/reline.rb:357:in `inner_readline'
        15: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/reline.rb:357:in `loop'
        14: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/reline.rb:358:in `block in inner_readline'
        13: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/reline.rb:387:in `read_io'
        12: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/reline.rb:387:in `loop'
        11: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/reline.rb:422:in `block in read_io'
        10: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/reline.rb:359:in `block (2 levels) in inner_readline'
         9: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/reline.rb:359:in `each'
         8: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/reline.rb:361:in `block (3 levels) in inner_readline'
         7: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/reline/line_editor.rb:445:in `rerender'
         6: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/reline/line_editor.rb:518:in `modify_lines'
         5: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/irb/input-method.rb:229:in `block in initialize'
         4: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/irb/color.rb:111:in `colorize_code'
         3: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/irb/color.rb:146:in `scan'
         2: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/ripper/lexer.rb:106:in `scan'
         1: from /home/hasumi/opt/ruby-head/lib/ruby/2.7.0/ripper/lexer.rb:123:in `parse'
/home/hasumi/opt/ruby-head/lib/ruby/2.7.0/ripper/lexer.rb:123:in `parse': [Ripper FATAL] unknown token -1 (RuntimeError)

Associated revisions

Revision 09755485
Added by nobu (Nobuyoshi Nakada) 5 months ago

Fix ripper fatal

  • parse.y (parser_yylex): return END_OF_INPUT at unterminated here document instead of an error. [Bug #15962]

History

Updated by shugo (Shugo Maeda) 5 months ago

  • Assignee set to aycabta (aycabta .)
  • Status changed from Open to Assigned

Updated by aycabta (aycabta .) 5 months ago

I can't reproduce it. Please show me a commit what you tried, and your irbrc.

Updated by aycabta (aycabta .) 5 months ago

It was my mistake and could reproduce. This is Ripper's matter.

#4

Updated by nobu (Nobuyoshi Nakada) 5 months ago

  • Status changed from Assigned to Closed

Applied in changeset git|097554855c1a9404f3220bcc5c1906cc62399b59.


Fix ripper fatal

  • parse.y (parser_yylex): return END_OF_INPUT at unterminated here document instead of an error. [Bug #15962]
#5

Updated by nobu (Nobuyoshi Nakada) 5 months ago

  • Backport changed from 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN to 2.4: DONTNEED, 2.5: DONTNEED, 2.6: DONTNEED

Also available in: Atom PDF