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

crash by typing right arrow in Stashes #178

Closed
Dubhead opened this issue Jul 7, 2020 · 2 comments
Closed

crash by typing right arrow in Stashes #178

Dubhead opened this issue Jul 7, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@Dubhead
Copy link

Dubhead commented Jul 7, 2020

Describe the bug

Typing right arrow in Stashes crashes gitui

To Reproduce

  1. Git-clone the gitui repository
  2. echo foo >> README.md
  3. git stash
  4. Start gitui
  5. Type 4 for Stashes screen
  6. Type the right arrow key

Expected behavior

The stash content should be displayed.

Screenshots

% git stash list
stash@{0}: WIP on master: 59d93d7 cargo update
% gitui
panic: PanicInfo { payload: Any, message: Some(failed to fetch: Git(Error { code: -1, klass: 0, message: "parent index out of bounds" })), location: Location { file: "/home/miura/.cargo/registry/src/github.com-1ecc6299db9ec823/asyncgit-0.8.0/src/commit_files.rs", line: 74, col: 13 } }
trace:
   0: gitui::set_panic_handlers::{{closure}}
   1: std::panicking::rust_panic_with_hook
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libstd/panicking.rs:515
   2: rust_begin_unwind
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libstd/panicking.rs:419
   3: core::panicking::panic_fmt
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libcore/panicking.rs:111
   4: core::option::expect_none_failed
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libcore/option.rs:1268
   5: core::result::Result<T,E>::expect
   6: <rayon_core::job::HeapJob<BODY> as rayon_core::job::Job>::execute
   7: std::sys_common::backtrace::__rust_begin_short_backtrace
   8: core::ops::function::FnOnce::call_once{{vtable.shim}}
   9: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/liballoc/boxed.rs:1008
      <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/liballoc/boxed.rs:1008
      std::sys::unix::thread::Thread::new::thread_start
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libstd/sys/unix/thread.rs:87
  10: start_thread
  11: __clone

panic: Any
trace:
   0: gitui::set_panic_handlers::{{closure}}
   1: rayon_core::registry::Registry::handle_panic
   2: <rayon_core::job::HeapJob<BODY> as rayon_core::job::Job>::execute
   3: std::sys_common::backtrace::__rust_begin_short_backtrace
   4: core::ops::function::FnOnce::call_once{{vtable.shim}}
   5: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/liballoc/boxed.rs:1008
      <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/liballoc/boxed.rs:1008
      std::sys::unix::thread::Thread::new::thread_start
             at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libstd/sys/unix/thread.rs:87
   6: start_thread
   7: __clone

[1]    12241 abort (core dumped)  gitui
%

Context (please complete the following information):

  • OS: Linux x86_64 (Fedora 32 Workstation with latest updates)
  • GitUI Version: 0.8.0
  • Rust version: 1.44.1

Additional context
Add any other context about the problem here.

@extrawurst
Copy link
Owner

@Dubhead thanks for reporting this, there seems to be a subtle difference in how git stash and libgit2 create a stash commit. libgit2 seems to always create the third parent necessary to stash untracked files and git stash skips that step when there are no untracked files to stash. this is the root cause for the crash. will be fixed

@extrawurst extrawurst added the bug Something isn't working label Jul 7, 2020
@Dubhead
Copy link
Author

Dubhead commented Jul 7, 2020

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants