dfinity / dfinity/candid

didc panics if I redirect output to a file with `<(...)` syntax

Open
#227 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
301
Forks
85
Avg merge
1h 4m
Merged PRs (30d)
4

Description

$ echo <(/home/omer/dfinity/candid/target/debug/didc encode ...)
/proc/self/fd/11
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 32, kind: BrokenPipe, message: "Broken pipe" }', tools/didc/src/main.rs:245:52
stack backtrace:
$    0: rust_begin_unwind
             at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:493:5
   1: std::panicking::begin_panic_fmt
             at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:435:5
   2: std::io::stdio::print_to
             at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/io/stdio.rs:940:9
   3: std::io::stdio::_print
             at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/io/stdio.rs:952:5
   4: didc::main
             at /home/omer/dfinity/candid/tools/didc/src/main.rs:244:13
   5: core::ops::function::FnOnce::call_once
             at /home/omer/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Trying with current master branch (a555d77704d691bb8f34e21a049d44ba0acee3f8)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tools/didc/src/main.rs around lines 244-245 and reproduce the issue using the reported didc command with <(...) output redirection. Check how output errors are handled when the pipe closes. Done means the same invocation no longer panics with a Broken pipe error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.