Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Jan 1997 08:10:01 -0800 (PST)
From:      davidn@unique.usn.blaze.net.au (David Nugent)
To:        freebsd-bugs
Subject:   Re: kern/2535: filesize-cur resource limit reset to "infinity"
Message-ID:  <199701201610.IAA08785@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/2535; it has been noted by GNATS.

From: davidn@unique.usn.blaze.net.au (David Nugent)
To: FreeBSD-gnats-submit@freebsd.org
Cc:  Subject: Re: kern/2535: filesize-cur resource limit reset to "infinity"
Date: Tue, 21 Jan 1997 03:04:05 +1100

 I wrote:
 > 	My first guess is that it appears to be related to the process
 > 	accounting database so that the data file will not be
 > 	stopped from growing by virtue of the filesize resource limit
 > 	for the exiting process, which suggests that this fix is wrong,
 > 	and perhaps the real fix would require saving and restoring this
 > 	resource limit around the call to acct_process(). I'll leave
 > 	that up to someone knows this code better than I do.
 > 
 > 	Alternative (assuming the above paragraph/guess is correct):
 > 
 > --- kern_exit.c.orig	Wed Jan 15 14:55:26 1997
 > +++ kern_exit.c	Tue Jan 21 01:57:27 1997
 > @@ -120,6 +120,7 @@
 >  	register struct proc *q, *nq;
 >  	register struct vmspace *vm;
 >  	ele_p ep = exit_list;
 > +	rlim_t fsize_cur;
 >  
 >  	if (p->p_pid == 1) {
 >  		printf("init died (signal %d, exit %d)\n",
 > @@ -222,8 +223,10 @@
 >  		sp->s_leader = NULL;
 >  	}
 >  	fixjobc(p, p->p_pgrp, 0);
 > -	p->p_rlimit[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
 > +	fsize_cur = p->p_rlimit[RLIMIT_FSIZE].rlim_cur;
 > +       p->p_rlimit[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
 >  	(void)acct_process(p);
 > +       p->p_rlimit[RLIMIT_FSIZE].rlim_cur = fsize_cur;
 >  #ifdef KTRACE
 >  	/*
 >  	 * release trace file
 
 Just to confirm that the above does in fact "fix" the problem.
 However, my feeling is that this is not the correct fix, since
 the way I read this code is that it is supposed to be setting
 the soft RLIMIT_FSIZE for the exiting process, not the parent
 process. How this comes to be, I have no idea, unless somehow
 the p_limit element in the exiting proc points to its parent
 at this point.
 
 
 Regards,
 
 David Nugent - Unique Computing Pty Ltd - Melbourne, Australia
 Voice +61-3-9791-9547  Data/BBS +61-3-9792-3507  3:632/348@fidonet
 davidn@freebsd.org davidn@blaze.net.au http://www.blaze.net.au/~davidn/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701201610.IAA08785>