]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
arg: Flush log before exiting after usage() (#25504)
authorChristian Kastner <redacted>
Tue, 14 Jul 2026 09:03:22 +0000 (11:03 +0200)
committerGitHub <redacted>
Tue, 14 Jul 2026 09:03:22 +0000 (12:03 +0300)
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.

common/arg.cpp

index 71118b3083213ed3c57a8542d172f6082bab7deb..9aefcd20297ab2ae95797564fd4ba6fb1a3701d4 100644 (file)
@@ -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) {