Date: Sat, 22 Sep 2001 10:30:02 -0700 (PDT) From: alex.neyman@auriga.ru To: freebsd-bugs@FreeBSD.org Subject: bin/30737: sysinstall leaks file descriptors on restart Message-ID: <200109221730.f8MHU2Z85308@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/30737; it has been noted by GNATS.
From: alex.neyman@auriga.ru
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: bin/30737: sysinstall leaks file descriptors on restart
Date: Sat, 22 Sep 2001 20:06:51 +0300 (EEST)
>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
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200109221730.f8MHU2Z85308>
