Bug 27275

Summary: kernel bug ? (negative sbsize)
Product: Base System Reporter: land <land>
Component: kernAssignee: Remko Lodder <remko>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.3-RELEASE   
Hardware: Any   
OS: Any   

Description land 2001-05-11 18:40:02 UTC
	After some uptime (20-30 housrs) in log files appears following messages:

	May 11 18:36:21 <kern.crit> gw2 /kernel: negative proccnt for uid = 65534
	May 11 18:36:21 <kern.crit> gw2 /kernel: freeing uidinfo: uid = 65534, sbsize = 34306
	May 11 18:36:21 <kern.crit> gw2 /kernel: freeing uidinfo: uid = 65534, proccnt = -1
	May 11 18:36:21 <kern.crit> gw2 /kernel: negative sbsize for uid = 1
	May 11 18:36:21 <kern.crit> gw2 /kernel: negative sbsize for uid = 1
	May 11 18:36:21 <kern.crit> gw2 /kernel: negative sbsize for uid = -16777216
	May 11 18:36:53 <kern.crit> gw2 last message repeated 202 times
	May 11 18:39:00 <kern.crit> gw2 last message repeated 1162 times
	May 11 18:42:12 <kern.crit> gw2 last message repeated 1830 times

	Last error message repeats until reboot.

How-To-Repeat: 
System runs as busy mail hub. PID wrap occurs each 8 hours.
Fresh installation. But old sendmail config (from version 8.6).
Comment 1 Jens Schweikhardt freebsd_committer freebsd_triage 2002-08-09 20:31:15 UTC
State Changed
From-To: open->feedback

Does this still happen with a recent release (4.6) or -stable?
Comment 2 land 2002-08-10 05:16:59 UTC
Hi !

Sometimes I see following lines in logs:
/kernel: negative proccnt for uid = 65534
/kernel: freeing uidinfo: uid = 65534, sbsize = 34306
/kernel: freeing uidinfo: uid = 65534, proccnt = -1

FreeBSD 4.6-R

--
Comment 3 Alexander Leidinger 2002-09-15 13:38:45 UTC
Hi,

I've got a report from a 4.6.2 System too which did a unwanted reboot
after:
---snip---
Sep 15 00:11:15 barney /kernel: negative sbsize for uid = 65534
Sep 15 00:11:47 barney last message repeated 747 times
Sep 15 00:13:43 barney last message repeated 5191 times
Sep 15 00:19:50 barney /kernel: Copyright (c) 1992-2002 The FreeBSD Project.
Sep 15 00:19:50 barney /kernel: Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
Sep 15 00:19:50 barney /kernel: The Regents of the University of California. All rights reserved.
Sep 15 00:19:50 barney /kernel: FreeBSD 4.6.2-RELEASE #0: Mon Sep  2 11:55:11 CEST 2002
Sep 15 00:19:50 barney /kernel: root@barney.ms-net.de:/usr/src/sys/compile/MOESTAVERNE
---snip---

There's an apache running as nobody on this system.

I don't know exactly what's going on in sys/kern/kern_resource.c, but I
think the printf() in case sbsize is negative isn't enough. Maybe
returning 0 if new is negative before we assign the new value may be
needed (I'm speculating without any knowledge about sbsize only based
upon comments in kern_resource.c (rev 1.107)).

Bye,
Alexander.

-- 
         The computer revolution is over. The computers won.

http://www.Leidinger.net                       Alexander @ Leidinger.net
  GPG fingerprint = C518 BC70 E67F 143F BE91  3365 79E2 9C60 B006 3FE7
Comment 4 Giorgos Keramidas freebsd_committer freebsd_triage 2003-02-28 21:21:30 UTC
State Changed
From-To: feedback->closed

Feedback timeout, after 6 months. 

Andrey, if you find the time in the future to test a newer release, 
you're always welcome to submit a new PR.
Comment 5 Giorgos Keramidas freebsd_committer freebsd_triage 2003-02-28 21:26:38 UTC
State Changed
From-To: closed->feedback

Grrmpf!  I hate it when lynx shows me only half of the PR text. 
This is certainly not ready to be closed, yet.
Comment 6 KAREN THODE 2003-05-18 01:59:00 UTC
I have a macro that will trap the exception, or you could change the type of the variable in question to an unsigned type.  The macro is as follows:

#define trapneg(arg) ((arg < 0)?arg=0:;)

Lucas
Comment 7 KAREN THODE 2003-07-03 20:02:02 UTC
arg = 3d0 should be changed to 0.
Comment 8 Remko Lodder freebsd_committer freebsd_triage 2006-11-12 10:32:53 UTC
State Changed
From-To: feedback->open

Open up the PR again, is this still relevant (yes that is normally a feedback 
question)?
Comment 9 Remko Lodder freebsd_committer freebsd_triage 2006-11-12 10:34:10 UTC
Responsible Changed
From-To: freebsd-bugs->remko

I'll take it.
Comment 10 Remko Lodder freebsd_committer freebsd_triage 2006-12-13 14:30:38 UTC
State Changed
From-To: open->closed

feedback timeout.