node: fix node-exe startup crashes in the CLI parser - #511
Conversation
The node executable crashed on any run that loads a config file (the normal
path), before doing any work. Three CLI11 issues in parser.cpp:
- `--help,-h` was added on top of CLI11's built-in help flag, throwing
OptionAlreadyAdded ("h is already added"). Clear the built-in with
set_help_flag() before registering our own.
- The config-file reload pass called set_config("--config", ...), whose option
name collides with the `--config,-c` already registered ("config is already
added"). Give the internal loader a distinct name.
- That same reload pass called app.parse(0, nullptr); CLI11 dereferences
argv[0], so a null argv segfaults. Pass a valid program-name argv.
With these, `kth -r -n mainnet -c <file>` starts and runs IBD.
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The node executable crashed on any run that loads a config file (the normal path), before doing any work. Three CLI11 issues in
parser.cpp:--help,-hduplicate — added on top of CLI11's built-in help flag →OptionAlreadyAdded: h is already added. Fixed by clearing the built-in withset_help_flag()before registering ours.configduplicate — the config-file reload pass calledset_config("--config", …), colliding with the already-registered--config,-c→OptionAlreadyAdded: config is already added. Fixed with a distinct internal loader name.app.parse(0, nullptr); CLI11 dereferencesargv[0], so a null argv segfaults. Fixed by passing a valid program-name argv.With these,
kth -r -n mainnet -c <file>starts and runs IBD (verified).