Date: Sun, 20 Jun 2010 23:48:51 +0300 From: Kostik Belousov <kostikbel@gmail.com> To: Bruce Cran <bruce@cran.org.uk> Cc: freebsd-current@freebsd.org Subject: Re: Bug in debug.ncores sysctl code Message-ID: <20100620204851.GA13238@deviant.kiev.zoral.com.ua> In-Reply-To: <201006202038.37579.bruce@cran.org.uk> References: <201006202038.37579.bruce@cran.org.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
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
@@ -2953,7 +2953,8 @@ 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);
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)
iEYEARECAAYFAkwefrMACgkQC3+MBN1Mb4ipigCfSjrr9FPyXbU2EF/LGrojF+EQ
ZPYAnRqV6GLgXWeE95OYj0/8L2ipfmFd
=ga4a
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100620204851.GA13238>
