You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A config error aborts with a core dump (SIGABRT) instead of exiting cleanly #126
initializeConfig(config_file) (src/main.cpp:574) is not inside a try/catch. Any exception it throws — an invalid flapi.yaml, a missing template directory, a malformed endpoint — reaches std::terminate, which flAPI has bound to terminateHandler (main.cpp:272):
voidterminateHandler() {
CROW_LOG_ERROR << "Unhandled exception caught! flapi is giving up :-(";
...
std::abort();
}
The diagnostic is printed, which is good. But std::abort() raises SIGABRT, so a plain config typo produces a core dump and exit code 134.
Evidence
Found while clearing scratch space — the integration run had left core dumps behind:
Two 360 KB dumps from one test session. The config-check tests feed deliberately bad configs, so every such run leaves dumps on disk.
Why it matters
Operators: a typo in flapi.yaml looks like flAPI crashed, not like a config error. The exit code says "abnormal termination by signal", and the process dumps core.
Kubernetes / systemd: a container exiting on SIGABRT is reported as a crash; with a bad ConfigMap this is a crash-loop that reads as a flAPI defect rather than a configuration one.
Disk: on hosts with core dumps enabled, every restart attempt writes one. flAPI's binary is ~77 MB, so these are not small.
Suggested fix
Wrap startup config loading in a try/catch in main, print the diagnostic, and return 1. Keep terminateHandler for genuinely unexpected exceptions — that is what it is for.
Not done as part of the current refactor work: the exit code changes from 134 to 1, which is observable behaviour, and anything scripting flapi could be reading it. Needs an owner decision, not a quiet correction.
initializeConfig is now inside a try/catch in main: a configuration error is reported and exits 1 instead of reaching std::terminate and aborting with SIGABRT and a core dump. terminateHandler stays for genuinely unexpected exceptions, which is what it is for.
Behaviour change: exit code 134 → 1.
Covered by test/integration/test_config_error_exit.py — malformed YAML and a missing config file both exit cleanly, and the message names what is wrong.
Activity
fix: three open issues that were filed because they change behaviour (#…
jrosskopf commentedon Sep 22, 2026
Fixed in #135 (merged as 23bd0f0).
initializeConfigis now inside a try/catch inmain: a configuration error is reported and exits 1 instead of reachingstd::terminateand aborting with SIGABRT and a core dump.terminateHandlerstays for genuinely unexpected exceptions, which is what it is for.Behaviour change: exit code 134 → 1.
Covered by
test/integration/test_config_error_exit.py— malformed YAML and a missing config file both exit cleanly, and the message names what is wrong.