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

Panic with broken symlink inside git repository #526

Closed
j-tai opened this issue Jul 15, 2019 · 7 comments
Closed

Panic with broken symlink inside git repository #526

j-tai opened this issue Jul 15, 2019 · 7 comments

Comments

@j-tai
Copy link
Contributor

j-tai commented Jul 15, 2019

exa version: exa v0.9.0 (479fdea built on 2019-07-15)

To reproduce:

$ git init
$ ln -s foo bar
$ exa -l --git

Backtrace:

thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:999:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:59
             at src/libstd/panicking.rs:197
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:211
   4: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:474
   5: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:381
   6: rust_begin_unwind
             at src/libstd/panicking.rs:308
   7: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
   8: core::result::unwrap_failed
             at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libcore/macros.rs:18
   9: core::result::Result<T,E>::unwrap
             at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libcore/result.rs:800
  10: exa::fs::feature::git::reorient
             at src/fs/feature/git.rs:268
  11: exa::fs::feature::git::Git::file_status
             at src/fs/feature/git.rs:241
  12: exa::fs::feature::git::Git::status
             at src/fs/feature/git.rs:236
  13: exa::fs::feature::git::GitRepo::search
             at src/fs/feature/git.rs:138
  14: exa::fs::feature::git::GitCache::get::{{closure}}
             at src/fs/feature/git.rs:32
  15: core::option::Option<T>::map
             at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libcore/option.rs:416
  16: exa::fs::feature::git::GitCache::get
             at src/fs/feature/git.rs:30
  17: exa::output::table::Table::git_status::{{closure}}
             at src/output/table.rs:363
  18: core::option::Option<T>::map
             at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libcore/option.rs:416
  19: exa::output::table::Table::git_status
             at src/output/table.rs:362
  20: exa::output::table::Table::display
             at src/output/table.rs:351
  21: exa::output::table::Table::row_for_file::{{closure}}
             at src/output/table.rs:322
  22: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold::{{closure}}
             at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libcore/iter/adapters/mod.rs:589
  23: <core::slice::Iter<T> as core::iter::traits::iterator::Iterator>::fold
             at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libcore/slice/mod.rs:3159
  24: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
             at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libcore/iter/adapters/mod.rs:589
  25: core::iter::traits::iterator::Iterator::for_each
             at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libcore/iter/traits/iterator.rs:604
  26: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::spec_extend
             at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/liballoc/vec.rs:1862
  27: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
             at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/liballoc/vec.rs:1845
  28: <alloc::vec::Vec<T> as core::iter::traits::collect::FromIterator<T>>::from_iter
             at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/liballoc/vec.rs:1731
  29: core::iter::traits::iterator::Iterator::collect
             at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libcore/iter/traits/iterator.rs:1465
  30: exa::output::table::Table::row_for_file
             at src/output/table.rs:321
  31: exa::output::details::Render::add_files_to_table::{{closure}}::{{closure}}::{{closure}}
             at src/output/details.rs:246
  32: core::option::Option<T>::map
             at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libcore/option.rs:416
  33: exa::output::details::Render::add_files_to_table::{{closure}}::{{closure}}
             at src/output/details.rs:246
  34: <F as scoped_threadpool::FnBox>::call_box
             at /home/jtai/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped_threadpool-0.1.9/src/lib.rs:71
  35: scoped_threadpool::Pool::new::{{closure}}
             at /home/jtai/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped_threadpool-0.1.9/src/lib.rs:127
thread 'main' panicked at 'Thread pool worker panicked', /home/jtai/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped_threadpool-0.1.9/src/lib.rs:236:13
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:59
             at src/libstd/panicking.rs:197
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:211
   4: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:474
   5: std::panicking::begin_panic
             at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libstd/panicking.rs:408
   6: scoped_threadpool::Scope::join_all
             at /home/jtai/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped_threadpool-0.1.9/src/lib.rs:236
   7: <scoped_threadpool::Scope as core::ops::drop::Drop>::drop
             at /home/jtai/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped_threadpool-0.1.9/src/lib.rs:248
   8: core::ptr::real_drop_in_place
             at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libcore/ptr.rs:195
   9: scoped_threadpool::Pool::scoped
             at /home/jtai/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped_threadpool-0.1.9/src/lib.rs:182
  10: exa::output::details::Render::add_files_to_table
             at src/output/details.rs:197
  11: exa::output::details::Render::render
             at ./src/output/details.rs:172
  12: exa::Exa<W>::print_files
             at ./src/exa.rs:239
  13: exa::Exa<W>::print_dirs
             at ./src/exa.rs:210
  14: exa::Exa<W>::run
             at ./src/exa.rs:157
  15: exa::main
             at src/bin/main.rs:16
  16: std::rt::lang_start::{{closure}}
             at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libstd/rt.rs:64
  17: std::panicking::try::do_call
             at src/libstd/rt.rs:49
             at src/libstd/panicking.rs:293
  18: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:85
  19: std::rt::lang_start_internal
             at src/libstd/panicking.rs:272
             at src/libstd/panic.rs:394
             at src/libstd/rt.rs:48
  20: std::rt::lang_start
             at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c/src/libstd/rt.rs:64
  21: main
  22: __libc_start_main
  23: _start
@lbenezriravin
Copy link

Maybe worth adding I only see the panic when --git is used in combination with -l and when the directory containing the symlink is actually a git directory. Otherwise works fine.

@j-tai j-tai changed the title Panic with broken symlink with --git Panic with broken symlink inside git repository Jul 21, 2019
@reorx
Copy link

reorx commented Sep 10, 2019

symlink to file/dir under git submodule that is not initialized will also cause this problem

msehnout pushed a commit to msehnout/exa that referenced this issue Sep 15, 2019
The issue including reproducer is described here:
ogham#526
This commit includes proposed change as well as integration test.
@BarbzYHOOL
Copy link

that didn't happen on 0.8 i think

@Lucretiel
Copy link

Can confirm this issue

@ogham
Copy link
Owner

ogham commented Jan 19, 2020

#584 should have taken care of this.

@ogham ogham closed this as completed Jan 19, 2020
@rpdelaney
Copy link

Perhaps it did, but there's no release with this fix still :( @ogham

@henrebotha
Copy link

Can we please get a release @ogham?

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

No branches or pull requests

8 participants