From owner-freebsd-bugs Sat Sep 22 9:10: 8 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 4981A37B41B for ; Sat, 22 Sep 2001 09:10:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f8MGA1l73527; Sat, 22 Sep 2001 09:10:01 -0700 (PDT) (envelope-from gnats) Received: from ns.any.ru (ns.any.ru [194.67.127.11]) by hub.freebsd.org (Postfix) with ESMTP id 9191937B406 for ; Sat, 22 Sep 2001 09:09:56 -0700 (PDT) Received: (from avn@localhost) by ns.any.ru (8.11.3/8.11.3) id f8MH6rN22399 for FreeBSD-gnats-submit@freebsd.org.AVP; Sat, 22 Sep 2001 20:06:53 +0300 (EEST) (envelope-from avn) Received: (from avn@localhost) by ns.any.ru (8.11.3/8.11.3) id f8MH6pD22390; Sat, 22 Sep 2001 20:06:51 +0300 (EEST) (envelope-from avn) Message-Id: <200109221706.f8MH6pD22390@ns.any.ru> Date: Sat, 22 Sep 2001 20:06:51 +0300 (EEST) From: alex.neyman@auriga.ru Reply-To: alex.neyman@auriga.ru To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: bin/30737: sysinstall leaks file descriptors on restart Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 30737 >Category: bin >Synopsis: sysinstall leaks file descriptors on restart >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Sep 22 09:10:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Alexey V. Neyman >Release: FreeBSD 4.4-RELEASE >Organization: Auriga, Inc. >Environment: n/a >Description: In a signal handler for ^C, the user is given a possibility to restart the installation utility. However, restart procedure does not close already open file descriptors, thus, new sysinstall starts with fewer fds. >How-To-Repeat: Run the installation; hit ^C, choose Restart and look at VTY2. You'll see that the fd number for ioctl(TIOCCONS) is rising each time you hit ^C -> Restart. >Fix: (the patch is untested) --- system.c.orig Sat Sep 22 19:49:49 2001 +++ system.c Sat Sep 22 19:52:33 2001 @@ -56,6 +56,11 @@ static int intr_restart(dialogMenuItem *self) { + int fd, fdmax; + + fdmax = getdtablesize(); + for (fd = 3; fd < fdmax; fd++) + close(fd); execl(StartName, StartName, (char *)NULL); /* NOTREACHED */ return -1; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message