From owner-freebsd-current@FreeBSD.ORG Sun Jun 20 20:49:15 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE00B106564A for ; Sun, 20 Jun 2010 20:49:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 3DEA38FC22 for ; Sun, 20 Jun 2010 20:49:14 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o5KKmqrZ050582 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 20 Jun 2010 23:48:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o5KKmqph090015; Sun, 20 Jun 2010 23:48:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o5KKmp8h090014; Sun, 20 Jun 2010 23:48:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 20 Jun 2010 23:48:51 +0300 From: Kostik Belousov To: Bruce Cran Message-ID: <20100620204851.GA13238@deviant.kiev.zoral.com.ua> References: <201006202038.37579.bruce@cran.org.uk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EyIqDK7+GVCmgGrt" Content-Disposition: inline In-Reply-To: <201006202038.37579.bruce@cran.org.uk> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_20, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-current@freebsd.org Subject: Re: Bug in debug.ncores sysctl code X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 20:49:15 -0000 --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--