From owner-freebsd-bugs@FreeBSD.ORG Tue Oct 28 12:00:35 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BE27516A4CF for ; Tue, 28 Oct 2003 12:00:35 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E137743FE5 for ; Tue, 28 Oct 2003 12:00:30 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h9SK0UFY036198 for ; Tue, 28 Oct 2003 12:00:30 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h9SK0Uow036197; Tue, 28 Oct 2003 12:00:30 -0800 (PST) (envelope-from gnats) Date: Tue, 28 Oct 2003 12:00:30 -0800 (PST) Message-Id: <200310282000.h9SK0Uow036197@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: John Baldwin Subject: Re: kern/58647: itimers aren't cleared on fork() X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: John Baldwin List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2003 20:00:36 -0000 The following reply was made to PR kern/58647; it has been noted by GNATS. From: John Baldwin To: freebsd-gnats-submit@FreeBSD.org Cc: Subject: Re: kern/58647: itimers aren't cleared on fork() Date: Tue, 28 Oct 2003 14:55:18 -0500 (EST) It seems that fork() doesn't explicitly clear the realtimer, rather p_realtimer is in the zero'd section of struct proc whereas the p_itimer array with the old real timer and the other two interval timers is in the copy section of p_stat. The patch below moves p_itimer to the zero section of p_stat instead: Index: resourcevar.h =================================================================== RCS file: /usr/cvs/src/sys/sys/resourcevar.h,v retrieving revision 1.35 diff -u -r1.35 resourcevar.h --- resourcevar.h 20 Apr 2003 13:54:04 -0000 1.35 +++ resourcevar.h 28 Oct 2003 19:51:10 -0000 @@ -52,11 +52,10 @@ #define pstat_startzero p_ru struct rusage p_ru; /* stats for this proc */ struct rusage p_cru; /* sum of stats for reaped children */ -#define pstat_endzero pstat_startcopy - -#define pstat_startcopy p_timer struct itimerval p_timer[3]; /* virtual-time timers */ +#define pstat_endzero pstat_startcopy +#define pstat_startcopy p_prof struct uprof { /* profile arguments */ caddr_t pr_base; /* buffer base */ u_long pr_size; /* buffer size */ -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/