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 hunk_header.rs:116:49 #765

Closed
krhubert opened this issue Nov 6, 2021 · 2 comments · Fixed by #823
Closed

🐛 panic hunk_header.rs:116:49 #765

krhubert opened this issue Nov 6, 2021 · 2 comments · Fixed by #823

Comments

@krhubert
Copy link

krhubert commented Nov 6, 2021

Hi,

I can't paste the git output because it's a private repo, but you can check stack trace.

$ git log  --since="6 months ago" --oneline --pretty="@@@%as"  --stat
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/git-delta-0.9.2/src/handlers/hunk_header.rs:116:49
stack backtrace:
   0:     0x561c390b8fc0 - std::backtrace_rs::backtrace::libunwind::trace::h577ea05e9ca4629a
                               at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/../../backtrace/src/backtrace/libunwind.rs:96
   1:     0x561c390b8fc0 - std::backtrace_rs::backtrace::trace_unsynchronized::h50b9b72b84c7dd56
                               at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/../../backtrace/src/backtrace/mod.rs:66
   2:     0x561c390b8fc0 - std::sys_common::backtrace::_print_fmt::h6541cf9823837fac
                               at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:79
   3:     0x561c390b8fc0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf64fbff071026df5
                               at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:58
   4:     0x561c390de36c - core::fmt::write::h9ddafa4860d8adff
                               at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/fmt/mod.rs:1082
   5:     0x561c390b5957 - std::io::Write::write_fmt::h1d2ee292d2b65481
                               at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/io/mod.rs:1514
   6:     0x561c390bb420 - std::sys_common::backtrace::_print::ha25f9ff5080d886d
                               at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:61
   7:     0x561c390bb420 - std::sys_common::backtrace::print::h213e8aa8dc5405c0
                               at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:48
   8:     0x561c390bb420 - std::panicking::default_hook::{{closure}}::h6482fae49ef9d963
                               at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:200
   9:     0x561c390bb16c - std::panicking::default_hook::he30ad7589e0970f9
                               at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:219
  10:     0x561c390bba83 - std::panicking::rust_panic_with_hook::haa1ed36ada4ffb03
                               at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:569
  11:     0x561c390bb659 - std::panicking::begin_panic_handler::{{closure}}::h7001af1bb21aeaeb
                               at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:476
  12:     0x561c390b944c - std::sys_common::backtrace::__rust_end_short_backtrace::h39910f557f5f2367
                               at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:153
  13:     0x561c390bb619 - rust_begin_unwind
                               at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:475
  14:     0x561c390dcbf1 - core::panicking::panic_fmt::h4e2659771ebc78eb
                               at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/panicking.rs:85
  15:     0x561c390dcb3d - core::panicking::panic::h4b079e3c35cc1b09
                               at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/panicking.rs:50
  16:     0x561c38f240b9 - delta::handlers::hunk_header::parse_hunk_header::h154f9a7f34fa8ee6
  17:     0x561c38f13765 - delta::handlers::hunk::<impl delta::delta::StateMachine>::handle_hunk_line::hd9ddd588a60639d9
  18:     0x561c38f0f7f4 - delta::delta::delta::hda41da6b1661abac
  19:     0x561c38e90197 - delta::main::hd6414381ca302648
  20:     0x561c38e8776a - std::sys_common::backtrace::__rust_begin_short_backtrace::h1b2dc25adba8ca75
  21:     0x561c38efcf73 - std::rt::lang_start::{{closure}}::h94926ffc04681f39
  22:     0x561c390bbf51 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h6a3209f124be2235
                               at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/ops/function.rs:259
  23:     0x561c390bbf51 - std::panicking::try::do_call::h88ce358792b64df0
                               at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:373
  24:     0x561c390bbf51 - std::panicking::try::h6311c259678e50fc
                               at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:337
  25:     0x561c390bbf51 - std::panic::catch_unwind::h56c5716807d659a1
                               at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panic.rs:379
  26:     0x561c390bbf51 - std::rt::lang_start_internal::h73711f37ecfcb277
                               at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/rt.rs:51
  27:     0x561c38e90902 - main
  28:     0x7fc04509a0b3 - __libc_start_main
  29:     0x561c38e5f5ae - _start
  30:                0x0 - <unknown>
@Kr1ss-XD
Copy link
Contributor

Kr1ss-XD commented Nov 6, 2021

Yep, looks like the combination of --stat and that --pretty option using multiple @ signs causes that.

To reproduce :

  • checkout e.g. delta's master branch
  • git -P log --stat --pretty="@@@%as" | delta --no-gitconfig
  • -> panicks.

Whereas all of the following commands work :

git -P log --stat | delta --no-gitconfig
git -P log --pretty="@@@%as" | delta --no-gitconfig
git -P log --stat --pretty="@%as" | delta --no-gitconfig

@dandavison
Copy link
Owner

Thanks @krhubert , this is fixed in the latest release (0.11.0)

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

Successfully merging a pull request may close this issue.

3 participants