From: Christian Kastner Date: Tue, 14 Jul 2026 09:03:22 +0000 (+0200) Subject: arg: Flush log before exiting after usage() (#25504) X-Git-Tag: upstream/0.0.10438~442 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=ec0dbef81632bb4233971fe83d91cf0accbfd882;p=pkg%2Fggml%2Fsources%2Fllama.cpp arg: Flush log before exiting after usage() (#25504) Under certain conditions, it's possible for messages emitted via LOG() to get lost before exit, apparently because they are emitted by another thread. common_params_print_usage() uses printf directly, and is not affected. Flushing the log before exit seems to resolve this. --- diff --git a/common/arg.cpp b/common/arg.cpp index 71118b308..9aefcd202 100644 --- a/common/arg.cpp +++ b/common/arg.cpp @@ -1077,6 +1077,7 @@ bool common_params_parse(int argc, char ** argv, common_params & params, llama_e if (ctx_arg.print_usage) { ctx_arg.print_usage(argc, argv); } + common_log_flush(common_log_main()); exit(0); } if (ctx_arg.params.completion) {