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

Piping nanoc show-data through less makes it crash #318

Closed
gpakosz opened this issue May 25, 2013 · 4 comments
Closed

Piping nanoc show-data through less makes it crash #318

gpakosz opened this issue May 25, 2013 · 4 comments

Comments

@gpakosz
Copy link
Member

gpakosz commented May 25, 2013

Here is a stacktrace, after I quit less:

$ nanoc show-data |less

Captain! We’ve been hit!

Message:

Errno::EPIPE: Broken pipe - 

Compilation stack:

  (empty)

Stack trace:

  0. /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/cleaning_stream.rb:74:in `write'
  1. /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/cleaning_stream.rb:74:in `puts'
  2. /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/cleaning_stream.rb:74:in `puts'
  3. /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/commands/show-data.rb:103:in `puts'
  4. /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/commands/show-data.rb:103:in `block in print_item_rep_outdatedness'
  5. /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/commands/show-data.rb:49:in `block (2 levels) in sorted_reps_with_prev'
  6. /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/commands/show-data.rb:48:in `each'
  7. /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/commands/show-data.rb:48:in `block in sorted_reps_with_prev'
  8. /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/commands/show-data.rb:47:in `each'
  9. /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/commands/show-data.rb:47:in `sorted_reps_with_prev'
  ... 18 more lines omitted. See full crash log for details.

If you believe this is a bug in nanoc, please do report it at
-> https://github.com/nanoc/nanoc/issues/new <-

A detailed crash log has been written to ./crash.log.

Captain! We’ve been hit!

Message:

Errno::EPIPE: Broken pipe

Compilation stack:

  (empty)

Stack trace:

  0. /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/cleaning_stream.rb:59:in `flush'
  1. /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/cleaning_stream.rb:59:in `flush'
  2. /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/error_handler.rb:322:in ``'
  3. /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/error_handler.rb:322:in `write_system_information'
  4. /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/error_handler.rb:149:in `write_verbose_error'
  5. /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/error_handler.rb:103:in `block in print_error'
  6. /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/error_handler.rb:100:in `open'
  7. /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/error_handler.rb:100:in `print_error'
  8. /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/error_handler.rb:77:in `rescue in handle_while'
  9. /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/error_handler.rb:55:in `handle_while'
  ... 14 more lines omitted. See full crash log for details.

If you believe this is a bug in nanoc, please do report it at
-> https://github.com/nanoc/nanoc/issues/new <-

A detailed crash log has been written to ./crash.log.
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/cleaning_stream.rb:59:in `flush': Broken pipe (Errno::EPIPE)
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/cleaning_stream.rb:59:in `flush'
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/error_handler.rb:322:in ``'
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/error_handler.rb:322:in `write_system_information'
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/error_handler.rb:149:in `write_verbose_error'
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/error_handler.rb:103:in `block in print_error'
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/error_handler.rb:100:in `open'
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/error_handler.rb:100:in `print_error'
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/error_handler.rb:77:in `rescue in handle_while'
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/error_handler.rb:55:in `handle_while'
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli/error_handler.rb:26:in `handle_while'
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/lib/nanoc/cli.rb:50:in `run'
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/nanoc-3.6.3/bin/nanoc:19:in `'
        from /usr/local/Cellar/ruby/2.0.0-p0/bin/nanoc:23:in `load'
        from /usr/local/Cellar/ruby/2.0.0-p0/bin/nanoc:23:in `'
$
@denisdefreyne
Copy link
Member

I’ve been unable to reproduce this so far.

This might be more of a problem with less. Does the same problem occur when using more or cat?

@gpakosz
Copy link
Member Author

gpakosz commented Sep 15, 2013

same with more

I'm reproducing it by doing nanoc show-data | less or nanoc show-data | more and I press q before the end of output.

@denisdefreyne
Copy link
Member

Yeah, this actually makes sense. I’m thinking of simply ignoring SIGPIPEs (Signal.trap("PIPE", "IGNORE")) or rescuing them in the appropriate places. Will fix!

@denisdefreyne
Copy link
Member

Fixed by #369.

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

No branches or pull requests

2 participants