Skip to content

flamegraph --completions zsh crashes #158

Description

@kammoh

flamegraph v0.4.0 (https://github.com/flamegraph-rs/flamegraph.git#02b05245)
Rust: stable-aarch64-apple-darwin 1.55.0 (c8dfcfe04 2021-09-06)

$ RUST_BACKTRACE=full flamegraph --completions zsh
thread 'main' panicked at 'Fatal internal error. Please consider filing a bug report at https://github.com/clap-rs/clap/issues', /Users/kamyar/.cargo/registry/src/github.life-white.uk-1ecc6299db9ec823/clap-2.33.3/src/completions/zsh.rs:346:29
stack backtrace:
   0:        0x1022269e4 - std::backtrace_rs::backtrace::libunwind::trace::h5bc01f52da331a76
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:        0x1022269e4 - std::backtrace_rs::backtrace::trace_unsynchronized::hed9f5f7d35868621
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:        0x1022269e4 - std::sys_common::backtrace::_print_fmt::hbabfbab394a5b2a4
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:67:5
   3:        0x1022269e4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he94cf96d727dca88
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:46:22
   4:        0x102243ccc - core::fmt::write::hba755d202326a972
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/fmt/mod.rs:1115:17
   5:        0x1022242f8 - std::io::Write::write_fmt::h2e794551090dcd0d
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/io/mod.rs:1665:15
   6:        0x10222862c - std::sys_common::backtrace::_print::hb13f9bf532a85f20
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:49:5
   7:        0x10222862c - std::sys_common::backtrace::print::h8bcbb8e054752f0b
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:36:9
   8:        0x10222862c - std::panicking::default_hook::{{closure}}::ha49ee092c99defdc
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:208:50
   9:        0x102228160 - std::panicking::default_hook::h878922f48a642f60
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:225:9
  10:        0x102228c74 - std::panicking::rust_panic_with_hook::h1daadfa06b290a08
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:622:17
  11:        0x1022287bc - std::panicking::begin_panic_handler::{{closure}}::h34f1299f5ae837e5
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:519:13
  12:        0x102226e74 - std::sys_common::backtrace::__rust_end_short_backtrace::hcec1a6222a82e10c
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/sys_common/backtrace.rs:141:18
  13:        0x102228720 - rust_begin_unwind
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:515:5
  14:        0x1022503b8 - core::panicking::panic_fmt::hb50b2a93e2b2795f
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/panicking.rs:92:14
  15:        0x102250304 - core::option::expect_failed::h98d7c7a72053f7b6
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/option.rs:1578:5
  16:        0x10220afb0 - clap::completions::zsh::get_args_of::h070f747b50c18ba1
  17:        0x10217b670 - clap::completions::zsh::ZshGen::generate_to::he4e74f92a6e9dc06
  18:        0x10217b97c - clap::completions::ComplGen::generate::h369edff8ec4f9b6c
  19:        0x10217bb0c - clap::app::App::gen_completions_to::h38f128a32464be2b
  20:        0x10217ed44 - flamegraph::main::h9b2e9775ebb960db
  21:        0x10217f764 - std::sys_common::backtrace::__rust_begin_short_backtrace::hcd4cecc7fa8f43f2
  22:        0x10217b400 - std::rt::lang_start::{{closure}}::ha60831df255221cc
  23:        0x10222914c - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::he38288968a08ce30
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/ops/function.rs:259:13
  24:        0x10222914c - std::panicking::try::do_call::hc5ee1d2a64b67a7c
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:401:40
  25:        0x10222914c - std::panicking::try::h6456708f12a6b661
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:365:19
  26:        0x10222914c - std::panic::catch_unwind::h0912a030777d678b
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs:434:14
  27:        0x10222914c - std::rt::lang_start_internal::{{closure}}::hd9cb206594099c49
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/rt.rs:45:48
  28:        0x10222914c - std::panicking::try::do_call::h75969ed557adb08d
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:401:40
  29:        0x10222914c - std::panicking::try::hd457662d949840e3
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panicking.rs:365:19
  30:        0x10222914c - std::panic::catch_unwind::he3438363c58e9600
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/panic.rs:434:14
  31:        0x10222914c - std::rt::lang_start_internal::h103433e957e14c30
                               at /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/std/src/rt.rs:45:20
  32:        0x10217f394 - _main

Activity

  1. kammoh commented on Oct 6, 2021

    @kammoh
    Author

    OK seems it was already mentioned by #153. Any fixes or workarounds?

  2. djc commented on Oct 7, 2021

    @djc
    Contributor

    Maybe file an issue against https://github.com/clap-rs/clap/ to ask them. I don't think there's anyone we can do here.

  3. kammoh commented on Oct 7, 2021

    @kammoh
    Author

    Not sure but seems to be related to clap-rs/clap#2220 which is already fixed upstream but there's not been a clap release since. If it's indeed the case, would a fix similar to denoland/deno#8718 work here?

  4. ede1998 commented on Oct 9, 2021

    @ede1998
    Contributor

    As far as I can see, they fixed it by moving the conflicts_with. However, flamegraph uses structopt instead of using clap directly. I don't know if we can access clap to do something similar. Maybe this must be fixed in structopt?

  5. djc commented on Oct 11, 2021

    @djc
    Contributor

    Yeah, we could file an issue with structopt to see if they can/would be willing to work around it.

  6. ede1998 commented on Oct 16, 2021

    @ede1998
    Contributor

    I created #161, which fixes the completion panic by removing the conflicts_with annotation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions