Crashes after C-r C-r #64

Closed
til opened this Issue Jul 2, 2012 · 1 comment

Projects

None yet

2 participants

@til
til commented Jul 2, 2012

Typing Ctrl-r for search backward twice crashes the console with the following stacktrace:


~/foo $ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
~/foo $ irb
irb(main):001:0> require 'rb-readline'
/home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rb-readline-0.4.2/lib/readline.rb:447: warning: already initialized constant HISTORY
/home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rb-readline-0.4.2/lib/readline.rb:476: warning: already initialized constant FILENAME_COMPLETION_PROC
/home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rb-readline-0.4.2/lib/readline.rb:508: warning: already initialized constant USERNAME_COMPLETION_PROC
/home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rb-readline-0.4.2/lib/readline.rb:514: warning: already initialized constant VERSION
true
# Typed C-r C-r here
(reverse-i-search)`': /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rb-readline-0.4.2/lib/rbreadline.rb:3985:in `include?': can't convert Fixnum into String (TypeError)
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rb-readline-0.4.2/lib/rbreadline.rb:3985:in `_rl_isearch_dispatch'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rb-readline-0.4.2/lib/rbreadline.rb:7083:in `rl_search_history'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rb-readline-0.4.2/lib/rbreadline.rb:7054:in `rl_reverse_search_history'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rb-readline-0.4.2/lib/rbreadline.rb:4262:in `_rl_dispatch_subseq'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rb-readline-0.4.2/lib/rbreadline.rb:4251:in `_rl_dispatch'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rb-readline-0.4.2/lib/rbreadline.rb:4669:in `readline_internal_charloop'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rb-readline-0.4.2/lib/rbreadline.rb:4743:in `readline_internal'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rb-readline-0.4.2/lib/rbreadline.rb:4765:in `readline'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rb-readline-0.4.2/lib/readline.rb:40:in `readline'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/irb/input-method.rb:115:in `gets'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/irb.rb:139:in `block (2 levels) in eval_input'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/irb.rb:273:in `signal_status'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/irb.rb:138:in `block in eval_input'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:188:in `call'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:188:in `buf_input'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:103:in `getc'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/irb/slex.rb:205:in `match_io'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/irb/slex.rb:75:in `match'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:286:in `token'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:262:in `lex'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:233:in `block (2 levels) in each_top_level_statement'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `loop'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `block in each_top_level_statement'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `catch'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `each_top_level_statement'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/irb.rb:155:in `eval_input'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/irb.rb:70:in `block in start'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/irb.rb:69:in `catch'
        from /home/tils/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/irb.rb:69:in `start'
        from /home/tils/.rbenv/versions/1.9.2-p290/bin/irb:12:in `<main>'

The error started to occur after I did a system wide upgrade of a lot of operating system packages of my archlinux system. The last system wide upgrade before was a couple of months ago, and I'm unable to guess which component could have this effect. Ruby and gems have stayed at the same version. I can reproduce the error in different terminal emulators (tried konsole and xterm).

@Spakman Spakman added a commit that closed this issue Jul 11, 2012
@Spakman Spakman Fixes #64: fix crash when pressing Ctrl-r Ctrl-r
Under Ruby 1.9, pressing Ctrl-r or any of the other special search keys
while already performing an interactive search would raise an exeption.

Tested-by: Mark Somerville <mark@scottishclimbs.com> [F17, MRI 1.9.3/1.8.7]
Signed-off-by: Mark Somerville <mark@scottishclimbs.com>
0f2cc13
@Spakman Spakman closed this in 0f2cc13 Jul 11, 2012
@til
til commented Aug 6, 2012

I somehow missed the notification, so a late: thanks for fixing this.

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