You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The second part of the "smoke test" step in the CircleCI pipeline was this command :
command: ./xebia-cli --help | head -n1 | grep xebia-cli`
It essentially just ran the CLI, got the first line which is supposed to look like xebia-cli X.Y thanks to clap and the cli.yml. It was recently disable because of a flaw that will take a bit of time to figure out and to fix.
Indeed, piping the output of xebia-cli to head -n1 makes it panic:
thread 'main' panicked at 'Error writing Error to stdout: Os { code: 32, kind: BrokenPipe, message: "Broken pipe" }', src/libcore/result.rs:997:5
It's not related in any way to our code and is totally reproducable with the following snippet only:
externcrate log;externcrate simplelog;use simplelog::*;externcrate clap;use clap::App;fnmain(){// Initialize logginglet term_logger = matchTermLogger::new(LevelFilter::Debug,Config::default()){Some(tl) => tl,None => {println!("Failed to create TermLogger; exiting.");
std::process::exit(1);}};CombinedLogger::init(vec![term_logger]).expect("Failed to initialize logger");// Reproduce bug
log::debug!("Here is a crash");let _matches = App::new("simplelog-broken-pipe-demo").get_matches();}
Building with and running it followed by a | head -n1 will result in the same crash.
Surprisingly, piping it to grep or a simple head without -n is not crashing the application.
This definitely has to be investigated, may it be only to discover WTF is going on here. It may be related to SIGPIPE being sent to the binary when a pipe is stopped brutally, which is not handled by Rust.
The second part of the "smoke test" step in the CircleCI pipeline was this command :
It essentially just ran the CLI, got the first line which is supposed to look like
xebia-cli X.Y
thanks toclap
and the cli.yml. It was recently disable because of a flaw that will take a bit of time to figure out and to fix.Indeed, piping the output of
xebia-cli
tohead -n1
makes it panic:It's not related in any way to our code and is totally reproducable with the following snippet only:
Building with and running it followed by a
| head -n1
will result in the same crash.Surprisingly, piping it to
grep
or a simplehead
without-n
is not crashing the application.This definitely has to be investigated, may it be only to discover WTF is going on here. It may be related to
SIGPIPE
being sent to the binary when a pipe is stopped brutally, which is not handled by Rust.Some references of a first look at this issue:
The text was updated successfully, but these errors were encountered: