From owner-freebsd-ports Wed Jul 15 20:50:55 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA07143 for freebsd-ports-outgoing; Wed, 15 Jul 1998 20:50:55 -0700 (PDT) (envelope-from owner-freebsd-ports@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA07134 for ; Wed, 15 Jul 1998 20:50:53 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id UAA07616; Wed, 15 Jul 1998 20:50:01 -0700 (PDT) Received: from gramlich.dyn.ml.org (usr2tc-54.fgi.net [208.149.190.54]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA06509 for ; Wed, 15 Jul 1998 20:43:29 -0700 (PDT) (envelope-from jayg@fgi.net) Received: (from gramlich@localhost) by gramlich.dyn.ml.org (8.8.8/8.8.8) id WAA11606; Wed, 15 Jul 1998 22:26:43 -0500 (CDT) (envelope-from gramlich) Message-Id: <199807160326.WAA11606@gramlich.dyn.ml.org> Date: Wed, 15 Jul 1998 22:26:43 -0500 (CDT) From: Jay Gramlich Reply-To: jayg@fgi.net To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: ports/7295: Starting programs with bash port causes problems when openfiles is set high Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 7295 >Category: ports >Synopsis: Starting programs with bash port causes problems when openfiles is set high >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jul 15 20:50:01 PDT 1998 >Last-Modified: >Originator: Jay Gramlich >Organization: >Release: FreeBSD 2.2.6-RELEASE i386 >Environment: FreeBSD londo.gramlich.lan 2.2.6-RELEASE FreeBSD 2.2.6-RELEASE #0: Sat Jul 11 15:54:11 CDT 1998 root@londo.gramlich.lan:/usr/src/sys/compile/LONDO i386 >Description: When using bash as the running shell and openfiles is set to a large value (>258?) some programs (rxvt, eterm) fail on a select call and chew up cpu time and which makes them appear to not work. This only happens when starting the program using bash (not sh or csh) and happens with both bash 1.x and 2.x. The effect is listed in another pr concerning rxvt. I'm not sure if this is a bug in bash or if bash is tickling something else. >How-To-Repeat: login as a user with high openfile limits. Compile and run this program. ---cut--- #include #include #include #include int main() { fd_set readfds; int retval; int fd; struct itimerval value; fd=open("/tmp/testselect",O_CREAT|O_RDWR, 0600); if (fd<0) exit(1); FD_ZERO(&readfds); FD_SET(fd,&readfds); value.it_value.tv_usec=0; value.it_value.tv_sec=1; retval=select(getdtablesize(), &readfds, NULL, NULL, &value.it_value); if (retval<0) perror("select"); printf("select returned: %i\n",retval); close(fd); unlink("/tmp/testselect"); exit(0); } ---cut--- When run under sh or csh the select call succeeds. Under bash it will fail with select:: Bad file descriptor select returned: -1 If you do a ulimit -n 258 - It works but with ulimit 259 it fail. >Fix: Don't use bash to start programs :-) >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message