flush runtime diagnostics promptly

This commit is contained in:
udo
2026-07-14 22:15:13 +00:00
parent 8c3f8c5e01
commit 0bcf9a676e
4 changed files with 58 additions and 0 deletions
+4
View File
@@ -1467,6 +1467,10 @@ void init_base_process()
int main(int argc, char** argv)
{
// systemd connects stdout to a pipe, which otherwise block-buffers child
// diagnostics and assigns stale failures a misleading later journal time.
setvbuf(stdout, 0, _IOLBF, 0);
setvbuf(stderr, 0, _IONBF, 0);
// Warm up libgcc's backtrace state so the first in-handler backtrace()
// after a fault does not allocate.
backtrace(request_fault_frames, 4);