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

Fix panic on startup in debug build #5917

Merged
merged 2 commits into from
Jun 13, 2024

Conversation

ackintosh
Copy link
Member

@ackintosh ackintosh commented Jun 11, 2024

Issue Addressed

Lighthouse in debug build panics on startup with the following error:

$ cargo build --bin lighthouse
$ target/debug/lighthouse bn

thread 'main' panicked at /Users/akihito/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.5.2/src/builder/debug_asserts.rs:341:13:
Command Lighthouse: command `account_manager` alias `account_manager` is duplicated
stack backtrace:
   0: rust_begin_unwind
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:72:14
   2: clap_builder::builder::debug_asserts::assert_app
             at /Users/akihito/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.5.2/src/builder/debug_asserts.rs:341:13
   3: clap_builder::builder::command::Command::_build_self
             at /Users/akihito/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.5.2/src/builder/command.rs:4123:13
   4: clap_builder::builder::command::Command::_do_parse
             at /Users/akihito/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.5.2/src/builder/command.rs:3994:9
   5: clap_builder::builder::command::Command::try_get_matches_from_mut
             at /Users/akihito/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.5.2/src/builder/command.rs:830:9
   6: clap_builder::builder::command::Command::get_matches_from
             at /Users/akihito/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.5.2/src/builder/command.rs:701:9
   7: clap_builder::builder::command::Command::get_matches
             at /Users/akihito/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.5.2/src/builder/command.rs:610:9
   8: lighthouse::main
             at ./lighthouse/src/main.rs:79:19
   9: core::ops::function::FnOnce::call_once
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread 'main' panicked at /Users/akihito/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.5.2/src/builder/debug_asserts.rs:341:13:
Command Lighthouse: command `validator_manager` alias `validator_manager` is duplicated
stack backtrace:
   0: rust_begin_unwind
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:72:14
   2: clap_builder::builder::debug_asserts::assert_app
             at /Users/akihito/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.5.2/src/builder/debug_asserts.rs:341:13
   3: clap_builder::builder::command::Command::_build_self
             at /Users/akihito/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.5.2/src/builder/command.rs:4123:13
   4: clap_builder::builder::command::Command::_do_parse
             at /Users/akihito/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.5.2/src/builder/command.rs:3994:9
   5: clap_builder::builder::command::Command::try_get_matches_from_mut
             at /Users/akihito/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.5.2/src/builder/command.rs:830:9
   6: clap_builder::builder::command::Command::get_matches_from
             at /Users/akihito/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.5.2/src/builder/command.rs:701:9
   7: clap_builder::builder::command::Command::get_matches
             at /Users/akihito/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.5.2/src/builder/command.rs:610:9
   8: lighthouse::main
             at ./lighthouse/src/main.rs:79:19
   9: core::ops::function::FnOnce::call_once
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Proposed Changes

It was because the alias was specified as the same as the subcommand name, so I removed it.

@ackintosh ackintosh changed the base branch from stable to unstable June 11, 2024 22:44
@ackintosh ackintosh force-pushed the fix-panic-in-debug branch from 0e59ac1 to a9336f1 Compare June 11, 2024 22:44
@ackintosh ackintosh marked this pull request as ready for review June 11, 2024 22:49
@ackintosh ackintosh added the ready-for-review The code is ready for review label Jun 11, 2024
@ackintosh
Copy link
Member Author

The CI failure in compile-with-beta-compiler will be fixed by #5916

Copy link
Member

@jimmygchen jimmygchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
I also ran into the same issue and made the changes locally but never remembered to commit 💀 . Thanks!

@jimmygchen
Copy link
Member

@ackintosh looks like CI needs some fixes - I think the beta compiler failure may not be related to your changes but a new Rust beta version.

The CLI help needs a fix though, if you run ``make cli-locallocally and commit the changes it should fix thecli-check` job.

@jimmygchen
Copy link
Member

Beta compiler fix is in #5916

@ackintosh
Copy link
Member Author

Thanks @jimmygchen !

@jimmygchen jimmygchen added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Jun 13, 2024
@michaelsproul
Copy link
Member

@Mergifyio queue

Copy link

mergify bot commented Jun 13, 2024

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at 5789db0

mergify bot added a commit that referenced this pull request Jun 13, 2024
@mergify mergify bot merged commit 5789db0 into sigp:unstable Jun 13, 2024
28 of 29 checks passed
@ackintosh ackintosh deleted the fix-panic-in-debug branch June 13, 2024 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge This PR is ready to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants