NetBSD Problem Report #59026

From www@netbsd.org  Thu Jan 23 19:57:46 2025
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 71C6C1A923A
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 23 Jan 2025 19:57:46 +0000 (UTC)
Message-Id: <20250123195745.343371A923B@mollari.NetBSD.org>
Date: Thu, 23 Jan 2025 19:57:45 +0000 (UTC)
From: ps@softinengines.com
Reply-To: ps@softinengines.com
To: gnats-bugs@NetBSD.org
Subject: Not functional syslogd option -S  Sync kernel messages to disk immediately.
X-Send-Pr-Version: www-1.0

>Number:         59026
>Category:       kern
>Synopsis:       Not functional syslogd option -S  Sync kernel messages to disk immediately.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 23 20:00:00 +0000 2025
>Originator:     Peter Skvarka
>Release:        10.1
>Organization:
Soft in Engines
>Environment:
NetBSD bsd.lan 10.1 NetBSD 10.1 (GENERIC)
>Description:
When syslogd is started with -S parameter (Sync kernel messages to disk immediately.) then it does not flush new messages from klog to syslog.
The reason are missing calls in src/sys/kern/subr_prf.c


>How-To-Repeat:
Start syslogd with -S switch. For example by adding syslogd_flags="-S" to rc.conf and reboot. 
Then try to run some kernel code with printf("some string"), for example create dummy kernel module which only loads and do print().
The message does not appear in /var/log/messages .

>Fix:
RVP provides patch:
https://mail-index.netbsd.org/tech-kern/2025/01/13/msg029950.html

---START PATCH---
--- src/sys/kern/subr_prf.c.orig	2023-08-29 21:23:14.000000000 +0000
+++ src/sys/kern/subr_prf.c	2025-01-13 08:37:45.789743655 +0000
@@ -1059,6 +1059,9 @@
 	va_start(ap, fmt);
 	vprintf_flags(TOLOG, fmt, ap);
 	va_end(ap);
+
+	if (!panicstr)
+		logwakeup();
 }

 /*
@@ -1104,6 +1107,9 @@
 	va_start(ap, fmt);
 	vprintf_flags(TOCONS | TOLOG, fmt, ap);
 	va_end(ap);
+
+	if (!panicstr)
+		logwakeup();
 }

 /*
---END PATCH---

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.