Skip to content

node: fix node-exe startup crashes in the CLI parser - #511

Merged
fpelliccioni merged 1 commit into
masterfrom
feature/node-startup-fixes
Jul 21, 2026
Merged

node: fix node-exe startup crashes in the CLI parser#511
fpelliccioni merged 1 commit into
masterfrom
feature/node-startup-fixes

Conversation

@fpelliccioni

Copy link
Copy Markdown
Contributor

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 duplicate — added on top of CLI11's built-in help flag → OptionAlreadyAdded: h is already added. Fixed by clearing the built-in with set_help_flag() before registering ours.
  • config duplicate — the config-file reload pass called set_config("--config", …), colliding with the already-registered --config,-cOptionAlreadyAdded: config is already added. Fixed with a distinct internal loader name.
  • Segfault — that reload pass called app.parse(0, nullptr); CLI11 dereferences argv[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).

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.
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • src/node/src/parser.cpp is excluded by !src/node/** and included by none

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f6bdca46-a1e3-4a2d-9c98-5853b33b0bcf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/node-startup-fixes

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@fpelliccioni
fpelliccioni merged commit 4ff747e into master Jul 21, 2026
23 of 24 checks passed
@fpelliccioni
fpelliccioni deleted the feature/node-startup-fixes branch July 21, 2026 16:28
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 this pull request may close these issues.

1 participant