From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22137 invoked from network); 12 Feb 2007 22:33:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.7 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 12 Feb 2007 22:33:03 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 55947 invoked from network); 12 Feb 2007 22:32:57 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 12 Feb 2007 22:32:57 -0000 Received: (qmail 2128 invoked by alias); 12 Feb 2007 22:32:54 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23166 Received: (qmail 2118 invoked from network); 12 Feb 2007 22:32:53 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 12 Feb 2007 22:32:53 -0000 Received: (qmail 55644 invoked from network); 12 Feb 2007 22:32:53 -0000 Received: from smtpout0147.sc1.he.tucows.com (HELO n064.sc1.he.tucows.com) (64.97.136.147) by a.mx.sunsite.dk with SMTP; 12 Feb 2007 22:32:47 -0000 Received: from sc.homeunix.net (82.26.171.77) by n064.sc1.he.tucows.com (7.2.069.1) id 45CB3FCD0004EEE7 for zsh-workers@sunsite.dk; Mon, 12 Feb 2007 22:32:45 +0000 Received: from chazelas by sc.homeunix.net with local (Exim 3.36 #1 (Debian)) id 1HGjix-0006wY-00 for ; Mon, 12 Feb 2007 22:32:39 +0000 Date: Mon, 12 Feb 2007 22:32:39 +0000 From: Stephane Chazelas To: Zsh hackers list Subject: echo > * and EMFILE Message-ID: <20070212223239.GA4812@sc.homeunix.net> Mail-Followup-To: Zsh hackers list Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.6i Sender: Stephane Chazelas Hi guys, $ touch {1..2000} $ : > * $ echo *(L1) | wc 1 1007 4921 zsh obviously couldn't open that many files, which is normal, the number of files a process can open at the same time is generally limited. But the problem here is that zsh didn't output any error message. So that the user might think he erased the content of every file when actually he didn't. Also: $ zsh -c 'zmodload zsh/net/tcp; for f ({1..1020}) ztcp -l $((f+2000))' ztcp: could not bind to port 40968: address already in use strace gives: bind(3, {sa_family=AF_INET, sin_port=htons(2208), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use) [...] write(2, "ztcp: could not bind to port 409"..., 59ztcp: could not bind to port 40968: address already in use There is someone indeed already listening on 2208, but not on 40968. strace also gives: bind(3, {sa_family=AF_INET, sin_port=htons(3014), sin_addr=inet_addr("0.0.0.0")}, 16) = 0 fcntl64(3, F_DUPFD, 10) = -1 EMFILE (Too many open files) bind(3, {sa_family=AF_INET, sin_port=htons(3015), sin_addr=inet_addr("0.0.0.0")}, 16) = 0 fcntl64(3, F_DUPFD, 10) = -1 EMFILE (Too many open files) bind(3, {sa_family=AF_INET, sin_port=htons(3016), sin_addr=inet_addr("0.0.0.0")}, 16) = 0 fcntl64(3, F_DUPFD, 10) = -1 EMFILE (Too many open files) bind(3, {sa_family=AF_INET, sin_port=htons(3017), sin_addr=inet_addr("0.0.0.0")}, 16) = 0 fcntl64(3, F_DUPFD, 10) = -1 EMFILE (Too many open files) bind(3, {sa_family=AF_INET, sin_port=htons(3018), sin_addr=inet_addr("0.0.0.0")}, 16) = 0 fcntl64(3, F_DUPFD, 10) = -1 EMFILE (Too many open files) bind(3, {sa_family=AF_INET, sin_port=htons(3019), sin_addr=inet_addr("0.0.0.0")}, 16) = 0 fcntl64(3, F_DUPFD, 10) = -1 EMFILE (Too many open files) bind(3, {sa_family=AF_INET, sin_port=htons(3020), sin_addr=inet_addr("0.0.0.0")}, 16) = 0 fcntl64(3, F_DUPFD, 10) = -1 EMFILE (Too many open files) but no error message. I get similar problems with zsocket. Cheers, Stéphane