Re: Bug in debug.ncores sysctl code

From: Kostik Belousov <kostikbel_at_gmail.com>
Date: Sun, 20 Jun 2010 23:48:51 +0300
On Sun, Jun 20, 2010 at 08:38:37PM +0100, Bruce Cran wrote:
> I noticed on my i386 router running 9-CURRENT that the "debug.ncores" sysctl 
> appears to get its value from some kernel memory that gets updated frequently:
> 
> debug.ncores: -936629388
> 
> On line 2967 of sys/kern/kern_sig.c should the value of num_cores instead of 
> ncores be getting returned?
"ncores" at the line 2967 is only the name of mib. The following patch
should fix it.

diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index d52cedb..63fe81e 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
_at__at_ -2953,7 +2953,8 _at__at_ sysctl_debug_num_cores_check (SYSCTL_HANDLER_ARGS)
 {
 	int error;
 	int new_val;
-	
+
+	new_val = num_cores;
 	error = sysctl_handle_int(oidp, &new_val, 0, req);
 	if (error != 0 || req->newptr == NULL)
 		return (error);

Received on Sun Jun 20 2010 - 18:49:15 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:04 UTC