Ctrl-C crashes guard
Author: OdaeusCreated Jun 16, 2016Updated Apr 5, 2025
Labelsbughelp neededwork in progress
Whenever I try to cancel running tests (with guard-rspec plugin) the guard shell crashes and the tests continue. I can reproduce simply by opening guard and pressing ctrl-c. Full debug session output and diagnostic info below. It might be related to ruby version as it works fine on 2.3.0 but not 2.3.1.
$ bundle exec guard --debug
13:09:37 - DEBUG - Notiffany: gntp not available (Please add "gem 'ruby_gntp'" to your Gemfile and run your app with "bundle exec".).
13:09:37 - DEBUG - Notiffany: growl not available (Unsupported platform "linux-gnu").
13:09:37 - DEBUG - Notiffany: terminal_notifier not available (Unsupported platform "linux-gnu").
13:09:37 - DEBUG - Notiffany: libnotify not available (Please add "gem 'libnotify'" to your Gemfile and run your app with "bundle exec".).
13:09:37 - DEBUG - Command execution: which notify-send
13:09:37 - DEBUG - Notiffany: notifysend not available (libnotify-bin package is not installed).
13:09:37 - DEBUG - Notiffany: notifu not available (Unsupported platform "linux-gnu").
13:09:37 - DEBUG - Command execution: {"ALTERNATE_EDITOR"=>"false"} emacsclient --eval '1'
13:09:37 - DEBUG - Notiffany: emacs not available (Emacs client failed).
13:09:37 - DEBUG - Command execution: tmux -V
13:09:37 - DEBUG - Notiffany: file not available (No :path option given).
13:09:37 - DEBUG - Command execution: tmux -V
13:09:37 - DEBUG - Notiffany is using Tmux to send notifications.
13:09:37 - DEBUG - Command execution: tmux list-clients -F '#{client_tty}'
13:09:37 - DEBUG - Command execution: tmux show -t /dev/pts/0
13:09:37 - DEBUG - Notiffany is using TerminalTitle to send notifications.
13:09:37 - DEBUG - Command execution: hash stty
13:09:37 - DEBUG - Guard starts all plugins
13:09:37 - DEBUG - Hook :start_begin executed for Guard::RSpec
13:09:37 - INFO - Guard::RSpec is running
13:09:37 - DEBUG - Hook :start_end executed for Guard::RSpec
13:09:38 - INFO - Guard is now watching at '/mnt/data1/home/andrew/projects/039-disciple/disciple-api'
13:09:38 - DEBUG - Start interactor
[1] guard(main)> [ pressed ctrl-c here ]
[1] guard(main)> ⏎ $ [typed a few random characters]
$ aError: Input/output error - read
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:198:in `readline'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:198:in `block in input_readline'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:115:in `interruptible_region'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:197:in `input_readline'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:183:in `block in read_line'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:129:in `handle_read_errors'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:170:in `read_line'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:98:in `read'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:68:in `block in repl'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:67:in `loop'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:67:in `repl'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:38:in `block in start'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:61:in `__with_ownership'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:79:in `with_ownership'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:38:in `start'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:15:in `start'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/pry_class.rb:169:in `start'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-byebug-3.4.0/lib/pry-byebug/pry_ext.rb:11:in `start_with_pry_byebug'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/guard-2.14.0/lib/guard/jobs/pry_wrapper.rb:102:in `block (2 levels) in _switch_to_pry'
[... this section below repeats several times ...]
[1] guard(main)> Error: Input/output error - read
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:198:in `readline'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:198:in `block in input_readline'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:115:in `interruptible_region'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:197:in `input_readline'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:183:in `block in read_line'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:129:in `handle_read_errors'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:170:in `read_line'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:98:in `read'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:68:in `block in repl'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:67:in `loop'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:67:in `repl'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:38:in `block in start'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:61:in `__with_ownership'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:79:in `with_ownership'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:38:in `start'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:15:in `start'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.3/lib/pry/pry_class.rb:169:in `start'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-byebug-3.4.0/lib/pry-byebug/pry_ext.rb:11:in `start_with_pry_byebug'
/home/andrew/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/guard-2.14.0/lib/guard/jobs/pry_wrapper.rb:102:in `block (2 levels) in _switch_to_pry'
[... end of repeating section ...]
[1] guard(main)> Error: Input/output error - read
FATAL: Pry failed to get user input using `Readline`.
To fix this you may be able to pass input and output file descriptors to pry directly. e.g.
Pry.config.input = STDIN
Pry.config.output = STDOUT
binding.pry
13:11:22 - DEBUG - Interactor was stopped or killed
13:11:22 - DEBUG - Guard stops all plugins
13:11:22 - DEBUG - Command execution: tmux set -q -u -t /dev/pts/0 status-left-bg
13:11:22 - DEBUG - Command execution: tmux set -q -u -t /dev/pts/0 status-right-bg
13:11:22 - DEBUG - Command execution: tmux set -q -u -t /dev/pts/0 status-left-fg
13:11:22 - DEBUG - Command execution: tmux set -q -u -t /dev/pts/0 status-right-fg
13:11:22 - DEBUG - Command execution: tmux set -q -u -t /dev/pts/0 message-bg
13:11:22 - DEBUG - Command execution: tmux set -q -u -t /dev/pts/0 message-fg
13:11:22 - DEBUG - Command execution: tmux set -q -u -t /dev/pts/0 display-time$ uname -a
Linux triton.avito.uk 4.5.0-x86_64-linode65 #2 SMP Mon Mar 14 18:01:58 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]As far as I can tell my Ruby 2.3.1 is compiled with Readline support:
$ ruby -rreadline -e 'puts Readline::VERSION'
6.3Unfortunately I'm not sure what the next steps are to debug this.
Source: guard/guard