Skip site navigation (1)Skip section navigation (2)
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

--EyIqDK7+GVCmgGrt
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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" sys=
ctl=20
> appears to get its value from some kernel memory that gets updated freque=
ntly:
>=20
> debug.ncores: -936629388
>=20
> On line 2967 of sys/kern/kern_sig.c should the value of num_cores instead=
 of=20
> 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;
-=09
+
+	new_val =3D num_cores;
 	error =3D sysctl_handle_int(oidp, &new_val, 0, req);
 	if (error !=3D 0 || req->newptr =3D=3D NULL)
 		return (error);

--EyIqDK7+GVCmgGrt
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkwefrMACgkQC3+MBN1Mb4ipigCfSjrr9FPyXbU2EF/LGrojF+EQ
ZPYAnRqV6GLgXWeE95OYj0/8L2ipfmFd
=ga4a
-----END PGP SIGNATURE-----

--EyIqDK7+GVCmgGrt--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100620204851.GA13238>