kern/53257: malloc() never returns 0

David Schultz das at FreeBSD.ORG
Fri Jun 13 02:30:13 PDT 2003


The following reply was made to PR kern/53257; it has been noted by GNATS.

From: David Schultz <das at FreeBSD.ORG>
To: Tony Gottfridsson <tony at expletus.se>
Cc: FreeBSD-gnats-submit at FreeBSD.ORG
Subject: Re: kern/53257: malloc() never returns 0
Date: Fri, 13 Jun 2003 02:27:41 -0700

 On Thu, Jun 12, 2003, Tony Gottfridsson wrote:
 > FreeBSD 4.5 malloc() never returns 0 and kills what seems to be
 > random processes, in my case apache seems to be the most likely
 > process to get killed first.
 
 You need to set resource limits on processes whose memory usage
 you wish to bound.  See the 'memoryuse' limit in login.conf(5).
 See also: limit(1) and setrlimit(3).
 
 > This process killing is out of security bounds, ie. normal user
 > malloc()ing forever can kill processes owned by root
 
 The normal behavior is to kill the largest process.  In FreeBSD
 5.1, thanks to Wes, root can designate processes as critical so
 they will not be killed.


More information about the freebsd-bugs mailing list