i386/100439: Possible wrong setrlimit() handling

kost kost at ropnet.ru
Mon Jul 17 15:00:33 UTC 2006


>Number:         100439
>Category:       i386
>Synopsis:       Possible wrong setrlimit() handling
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-i386
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 17 15:00:31 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     kost
>Release:        FreeBSD 6.1-RELEASE-p2
>Organization:
RopNet
>Environment:
FreeBSD www4.ropnet.ru 6.1-RELEASE-p2 FreeBSD 6.1-RELEASE-p2 #1: Mon Jun 26 23:56:29 MSD 2006     mar at www4.ropnet.ru:/usr/obj/usr/src/sys/WWW4  i386
>Description:
I've got a wrapper written in C.
It sets some limits on other scripts, which started in this wrapper.
Program makes syscall setrlimit() with RLIMIT_CPU, RLIMIT_NPROC limitations and than starts some perl script like this:
  #!/usr/bin/perl
  while(1){;}

This program eats CPU and dies after few seconds depending on RLIMIT_CPU parameter. There is no problem - everything correct. But there is no string in log files about process killing. I expect the following string in logs:
  pid 32429 (perl5.8.7), uid 0, was killed: exceeded maximum CPU limit
but it's empty.

Talking about RLIMIT_NPROC limit - everything Ok.
I've tested this script on old 5.2.1-RELEASE FreeBSD... there was no questions... everything Ok too.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-i386 mailing list