NetBSD Problem Report #45598

From yamt@NetBSD.org  Fri Nov 11 10:08:41 2011
Return-Path: <yamt@NetBSD.org>
Received: by www.NetBSD.org (Postfix, from userid 1270)
	id C389F63BEB2; Fri, 11 Nov 2011 10:08:41 +0000 (UTC)
Message-Id: <20111111100841.C389F63BEB2@www.NetBSD.org>
Date: Fri, 11 Nov 2011 10:08:41 +0000 (UTC)
From: yamt@NetBSD.org
Reply-To: yamt@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: expanding uvmexp_sysctl makes top etc fail
X-Send-Pr-Version: 3.95

>Number:         45598
>Category:       kern
>Synopsis:       expanding uvmexp_sysctl makes top etc fail
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Nov 11 10:10:00 +0000 2011
>Closed-Date:    Fri Sep 30 08:31:05 +0000 2016
>Last-Modified:  Fri Sep 30 08:31:05 +0000 2016
>Originator:     YAMAMOTO Takashi
>Release:        NetBSD current
>Organization:

>Environment:


>Description:
	despite of the comments on the definition of uvmexp_sysctl,
	adding new members to the end of the structure actually breaks the abi.

		% top
		top: sysctl vm.uvmexp2 failed: Cannot allocate memory

	cf.  http://mail-index.netbsd.org/tech-kern/2005/11/09/0002.html

>How-To-Repeat:

>Fix:


>Release-Note:

>Audit-Trail:
From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org, 
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: kern/45598: expanding uvmexp_sysctl makes top etc fail
Date: Fri, 11 Nov 2011 10:14:16 -0500

 On Nov 11, 10:10am, yamt@NetBSD.org (yamt@NetBSD.org) wrote:
 -- Subject: kern/45598: expanding uvmexp_sysctl makes top etc fail

 | 	despite of the comments on the definition of uvmexp_sysctl,
 | 	adding new members to the end of the structure actually breaks the abi.
 | 
 | 		% top
 | 		top: sysctl vm.uvmexp2 failed: Cannot allocate memory
 | 
 | 	cf.  http://mail-index.netbsd.org/tech-kern/2005/11/09/0002.html
 | 

 Does this fix it?

 christos

 Index: uvm_meter.c
 ===================================================================
 RCS file: /cvsroot/src/sys/uvm/uvm_meter.c,v
 retrieving revision 1.56
 diff -u -u -r1.56 uvm_meter.c
 --- uvm_meter.c	2 Feb 2011 15:25:27 -0000	1.56
 +++ uvm_meter.c	11 Nov 2011 15:13:47 -0000
 @@ -180,6 +180,8 @@
  	node = *rnode;
  	node.sysctl_data = &u;
  	node.sysctl_size = sizeof(u);
 +	if (oldp)
 +		node.sysctl_size = min(*oldlenp, node.sysctl_size);
  	return (sysctl_lookup(SYSCTLFN_CALL(&node)));
  }


From: yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi)
To: christos@zoulas.com
Cc: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: kern/45598: expanding uvmexp_sysctl makes top etc fail
Date: Sun, 13 Nov 2011 01:35:18 +0000 (UTC)

 > Does this fix it?

 thanks.  i'll try.

 YAMAMOTO Takashi

From: "YAMAMOTO Takashi" <yamt@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45598 CVS commit: [yamt-pagecache] src/sys/uvm
Date: Sun, 13 Nov 2011 01:36:25 +0000

 Module Name:	src
 Committed By:	yamt
 Date:		Sun Nov 13 01:36:25 UTC 2011

 Modified Files:
 	src/sys/uvm [yamt-pagecache]: uvm_meter.c

 Log Message:
 a patch supposed to unbreak abi from christos@
 PR/45598


 To generate a diff of this commit:
 cvs rdiff -u -r1.56.4.2 -r1.56.4.3 src/sys/uvm/uvm_meter.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Fri, 04 Jan 2013 02:52:19 +0000
State-Changed-Why:
Did the patch fix the problem?


State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Fri, 30 Sep 2016 08:31:05 +0000
State-Changed-Why:
feedback timeout


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.