Compare commits

...

1 Commits

Author SHA1 Message Date
Bart
4eeed5515e fix: Report a rejected config section instead of aborting
makeApplication and Application::setup read config sections and throw
for one they reject. Neither call was wrapped, and main installs no
handler, so a missing [node_db] or an unparseable [node_seed] reached
the C++ runtime: "libc++abi: terminating due to uncaught exception"
followed by SIGABRT and exit 134. The [node_seed] case aborted after the
job queue had already started.

Both calls now sit in a try that writes the reason to stderr and exits
1.

run() is not reachable from a suite, so this is verified against a built
binary. A config with no [node_db] prints "xrpld: invalid configuration:
Missing [node_db] entry in configuration file" and exits 1. One whose
[node_seed] does not parse prints its own reason and exits 1. Both
aborted before.
2026-10-02 20:28:36 -04:00

View File

@@ -804,11 +804,22 @@ run(int argc, char** argv)
if (vm.contains("debug"))
setDebugLogSink(logs->makeSink("Debug", beast::Severity::Trace));
auto app =
makeApplication(std::move(config), std::move(logs), std::make_unique<TimeKeeper>());
// Building the application and setting it up both read config
// sections, and throw for a section they reject.
std::unique_ptr<Application> app;
try
{
app =
makeApplication(std::move(config), std::move(logs), std::make_unique<TimeKeeper>());
if (!app->setup(vm))
return -1;
if (!app->setup(vm))
return -1;
}
catch (std::exception const& e)
{
std::cerr << "xrpld: invalid configuration: " << e.what() << std::endl;
return 1;
}
// With our configuration parsed, ensure we have
// enough file descriptors available: