Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentError & exit while typing in IRB on JRuby 9.3 #295

Closed
byteit101 opened this issue Sep 25, 2021 · 2 comments · Fixed by #403
Closed

ArgumentError & exit while typing in IRB on JRuby 9.3 #295

byteit101 opened this issue Sep 25, 2021 · 2 comments · Fixed by #403

Comments

@byteit101
Copy link
Contributor

Description

Expected: typing shouldn't ever throw an exception and exit the prompt

Actual: sometimes, typing (quickly?) causes an uncaught exception and exit (see below). Note it its never consistent, but typing methods on objects seems to throw within 5 lines of messing around. This is a fresh install of the new JRuby 9.3 release( @headius )

Result of irb_info & the stack trace

$ irb
jruby-9.3.0.0 :001 > irb_info
 => 
Ruby version: 2.6.8
IRB version: irb 1.3.7 (2021-08-12)
InputMethod: ReidlineInputMethod with Reline 0.2.7
.irbrc path: /home/byteit101/.rvm/rubies/jruby-9.3.0.0/.irbrc
RUBY_PLATFORM: java
LANG env: en_US.UTF-8
 
jruby-9.3.0.0 :002 > jr = JRuby.reference0(self)
 => #<Object:0x2101b44a @prompt={:PROMPT_I=>"jruby-9.3.0.0 :%03n > ", :PROMPT_S=>"jruby-9.3.0.0 :%03n%l> ", :PROMPT_C=>"jruby-9.3.0.0 :%03n > ", :PROMPT_N=>"jruby-9.3.0.0 :%03n?> ", :RETURN=>" => %s \n", :... 
jruby-9.3.0.0 :003 > jr.java_class
 => #<Java::JavaLang::Class: org.jruby.RubyObject> 
ArgumentError: missing keyword: complete # overwriting a line of me saying jr.metho
                initialize at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/irb-1.3.7/lib/irb/input-method.rb:287
              modify_lines at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/reline-0.2.7/lib/reline/line_editor.rb:785
        render_whole_lines at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/reline-0.2.7/lib/reline/line_editor.rb:661
        rerender_all_lines at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/reline-0.2.7/lib/reline/line_editor.rb:641
                  rerender at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/reline-0.2.7/lib/reline/line_editor.rb:434
            inner_readline at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/reline-0.2.7/lib/reline.rb:250
                      each at org/jruby/RubyArray.java:1865
            inner_readline at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/reline-0.2.7/lib/reline.rb:248
                   read_io at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/reline-0.2.7/lib/reline.rb:334
                      loop at org/jruby/RubyKernel.java:1507
                   read_io at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/reline-0.2.7/lib/reline.rb:288
            inner_readline at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/reline-0.2.7/lib/reline.rb:246
                      loop at org/jruby/RubyKernel.java:1507
            inner_readline at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/reline-0.2.7/lib/reline.rb:244
             readmultiline at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/reline-0.2.7/lib/reline.rb:178
             readmultiline at /home/byteit101/.rvm/rubies/jruby-9.3.0.0/lib/ruby/stdlib/forwardable.rb:230
             readmultiline at /home/byteit101/.rvm/rubies/jruby-9.3.0.0/lib/ruby/stdlib/forwardable.rb:230
                      gets at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/irb-1.3.7/lib/irb/input-method.rb:319
                eval_input at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/irb-1.3.7/lib/irb.rb:529
             signal_status at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/irb-1.3.7/lib/irb.rb:758
                eval_input at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/irb-1.3.7/lib/irb.rb:528
                       lex at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/irb-1.3.7/lib/irb/ruby-lex.rb:282
  each_top_level_statement at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/irb-1.3.7/lib/irb/ruby-lex.rb:251
                      loop at org/jruby/RubyKernel.java:1507
  each_top_level_statement at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/irb-1.3.7/lib/irb/ruby-lex.rb:248
                     catch at org/jruby/RubyKernel.java:1237
  each_top_level_statement at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/irb-1.3.7/lib/irb/ruby-lex.rb:247
                eval_input at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/irb-1.3.7/lib/irb.rb:547
                       run at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/irb-1.3.7/lib/irb.rb:481
                     catch at org/jruby/RubyKernel.java:1237
                       run at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/irb-1.3.7/lib/irb.rb:480
                     start at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/irb-1.3.7/lib/irb.rb:409
                    <main> at /home/byteit101/.rvm/gems/jruby-9.3.0.0/gems/irb-1.3.7/exe/irb:11
                      load at org/jruby/RubyKernel.java:1052
                    <main> at /home/byteit101/.rvm/gems/jruby-9.3.0.0/bin/irb:23
$

Terminal Emulator

gnome-terminal

Setting Files

Are you using ~/.irbrc and ~/.inputrc? No

@headius
Copy link
Contributor

headius commented Sep 30, 2021

I will help investigate this.

I would have thought this is a problem with our FFI-based io-console, but that passes all tests. There's something I'm missing.

@byteit101
Copy link
Contributor Author

FWIW recently the traces have changed slightly, or I'm doing something different here:

jruby-9.3.4.0 :028 > IRB.CurrentContext.inArgumentError: Java package 'java' does not have a method `instance_methods' with 1 argument
            method_missing at org/jruby/javasupport/JavaPackage.java:259
            InputCompletor at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/lib/ruby/stdlib/irb/completion.rb:175
               each_object at org/jruby/RubyObjectSpace.java:189
            InputCompletor at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/lib/ruby/stdlib/irb/completion.rb:173
                  readline at org/jruby/ext/readline/Readline.java:214
                      gets at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/lib/ruby/stdlib/irb/input-method.rb:151
                eval_input at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/lib/ruby/stdlib/irb.rb:473
             signal_status at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/lib/ruby/stdlib/irb.rb:647
                eval_input at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/lib/ruby/stdlib/irb.rb:472
                 buf_input at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/lib/ruby/stdlib/irb/ruby-lex.rb:189
                      getc at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/lib/ruby/stdlib/irb/ruby-lex.rb:104
                  match_io at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/lib/ruby/stdlib/irb/slex.rb:206
                     match at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/lib/ruby/stdlib/irb/slex.rb:76
                     token at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/lib/ruby/stdlib/irb/ruby-lex.rb:292
                       lex at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/lib/ruby/stdlib/irb/ruby-lex.rb:266
  each_top_level_statement at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/lib/ruby/stdlib/irb/ruby-lex.rb:236
                      loop at org/jruby/RubyKernel.java:1507
  each_top_level_statement at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/lib/ruby/stdlib/irb/ruby-lex.rb:232
                     catch at org/jruby/RubyKernel.java:1237
  each_top_level_statement at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/lib/ruby/stdlib/irb/ruby-lex.rb:231
                eval_input at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/lib/ruby/stdlib/irb.rb:489
                       run at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/lib/ruby/stdlib/irb.rb:428
                     catch at org/jruby/RubyKernel.java:1237
                       run at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/lib/ruby/stdlib/irb.rb:427
                     start at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/lib/ruby/stdlib/irb.rb:383
                    <main> at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/lib/ruby/gems/shared/gems/irb-1.0.0/exe/irb:11
                      load at org/jruby/RubyKernel.java:1052
                    <main> at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/bin/irb:23
                      eval at org/jruby/RubyKernel.java:1091
                    <main> at /home/byteit101/.rvm/rubies/jruby-9.3.4.0/bin/jruby_executable_hooks:22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants