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

Error after successful return (bug not located): "Unwrap error", after printing -1's result #678

Closed
mcint opened this issue Oct 27, 2020 · 4 comments · Fixed by #679
Closed
Labels

Comments

@mcint
Copy link

mcint commented Oct 27, 2020

Describe the bug you encountered:
Query returns or reports and error after normal, successful usage.

Describe what you expected to happen:
Print result of fd -d 3 -1 cheat.sheets . and exit.

Does not error on fd -d 3 -1 cheat.sheets, without final . search path arg.

What version of fd are you using?
fd 8.1.1
Which operating system / distribution are you on?
Darwin 18.7.0 x86_64

^C^C
$ env RUST_BACKTRACE=1 fd -d 3 -1 cheat.sheets .
hosting/Reference/cheat.sheets
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: "SendError(..)"', src/walk.rs:371:21
stack backtrace:
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: "SendError(..)"', src/walk.rs:371:21
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: "SendError(..)"', src/walk.rs:371:21
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::rust_panic_with_hook
   5: rust_begin_unwind
   6: core::panicking::panic_fmt
   7: core::result::unwrap_failed
   8: fd::walk::spawn_senders::{{closure}}::{{closure}}
   9: <ignore::walk::FnVisitorImp as ignore::walk::ParallelVisitor>::visit
  10: ignore::walk::Worker::run_one
  11: crossbeam_utils::thread::ScopedThreadBuilder::spawn::{{closure}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::rust_panic_with_hook
   5: rust_begin_unwind
   6: core::panicking::panic_fmt
   7: core::result::unwrap_failed
   8: fd::walk::spawn_senders::{{closure}}::{{closure}}
   9: <ignore::walk::FnVisitorImp as ignore::walk::ParallelVisitor>::visit
  10: ignore::walk::Worker::run_one
  11: crossbeam_utils::thread::ScopedThreadBuilder::spawn::{{closure}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Any', /Users/brew/Library/Caches/Homebrew/cargo_cache/registry/src/github.com-1ecc6
299db9ec823/ignore-0.4.15/src/walk.rsstack backtrace:
:1294:17
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::rust_panic_with_hook
   5: rust_begin_unwind
   6: core::panicking::panic_fmt
   7: core::result::unwrap_failed
   8: fd::walk::spawn_senders::{{closure}}::{{closure}}
   9: <ignore::walk::FnVisitorImp as ignore::walk::ParallelVisitor>::visit
  10: ignore::walk::Worker::run_one
  11: crossbeam_utils::thread::ScopedThreadBuilder::spawn::{{closure}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::rust_panic_with_hook
   5: rust_begin_unwind
   6: core::panicking::panic_fmt
   7: core::result::unwrap_failed
   8: ignore::walk::WalkParallel::visit
   9: fd::walk::scan
  10: fd::run
  11: fd::main
  12: std::rt::lang_start::{{closure}}
  13: main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
@mcint mcint added the bug label Oct 27, 2020
@mcint
Copy link
Author

mcint commented Oct 27, 2020

Uhh. Regarding /Users/brew/Library/Caches/Homebrew/cargo_cache/registry/src/github.com-1ecc6299db9ec823/ignore-0.4.15/src/walk.rs...stack backtrace:...``:1294:17`

I don't even have ignore-0.4.15 in the cargo sources. I think this is probably a packaging bug, brew.

λ ~ fd walk.rs .cargo
.cargo/registry/src/github.com-1ecc6299db9ec823/ignore-0.4.10/examples/walk.rs
.cargo/registry/src/github.com-1ecc6299db9ec823/ignore-0.4.10/src/walk.rs
.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.13.8/src/revwalk.rs
.cargo/registry/src/github.com-1ecc6299db9ec823/ignore-0.4.14/src/walk.rs
.cargo/registry/src/github.com-1ecc6299db9ec823/ignore-0.4.14/examples/walk.rs

@sharkdp
Copy link
Owner

sharkdp commented Oct 27, 2020

Thank you for reporting this. I actually managed to reproduce it (it also hangs for me sometimes) and I think it can be fixed easily. The problem appears in directories with permission problems (that would show up when using --show-errors). For me, I can do this in /etc to provoke the bug:

fd -1 -d3 foo

We shouldn't have used .unwrap() on send(…) calls.

@sharkdp
Copy link
Owner

sharkdp commented Oct 27, 2020

Should be fixed via #679.

@sharkdp
Copy link
Owner

sharkdp commented Dec 6, 2020

fix released in v8.2.0.

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

Successfully merging a pull request may close this issue.

2 participants