zsh-workers
 help / color / mirror / code / Atom feed
* echo > * and EMFILE
@ 2007-02-12 22:32 Stephane Chazelas
  2007-02-13 10:53 ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Stephane Chazelas @ 2007-02-12 22:32 UTC (permalink / raw)
  To: Zsh hackers list

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-02-14  7:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-12 22:32 echo > * and EMFILE Stephane Chazelas
2007-02-13 10:53 ` Peter Stephenson
2007-02-13 17:11   ` Bart Schaefer
2007-02-13 17:28     ` Peter Stephenson
2007-02-14  7:53       ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).