Bug in debug.ncores sysctl code
Kostik Belousov
kostikbel at gmail.com
Sun Jun 20 20:49:15 UTC 2010
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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20100620/0878eede/attachment.pgp
More information about the freebsd-current
mailing list