develooper Front page | perl.perl5.porters | Postings from September 2005

Re: [perl #33831] [PATCH] EMFILE misinterpretation

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
September 28, 2005 04:38
Subject:
Re: [perl #33831] [PATCH] EMFILE misinterpretation
Message ID:
20050928113806.GM1790@plum.flirble.org
On Tue, Sep 27, 2005 at 07:40:28PM -0700, Steve Peters via RT wrote:

> This problem has come up before with the solution being to simply
> increase the max open filehandles.  This error message, however, is very
> confusing.  I'm suggesting something like the following patch to clarify
> the situation.  Not knowing Perl's internals that well, can someone
> please look this over before I apply it?  Also, I'm simply using
> strerror(errno) to get the error message.  Any other suggestions?
> I tested the patch with and without threads and it worked fine.  Here's
> a quick test showing the difference.

I don't know about errno particularly, but I see some messy logic in
case '!' in mg.c that sets $!, which seems to use a Strerror macro.

> steve@kirk:~/perl-current$ ulimit -n
> 4
> steve@kirk:~/perl-current$ perl5.8.7 -MCarp -e1
> Can't locate Carp.pm in @INC (@INC contains: /etc/perl
> /usr/local/lib/perl/5.8.7 /usr/local/share/perl/5.8.7 /usr/lib/perl5
> /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8
> /usr/local/lib/site_perl /usr/local/lib/perl/5.8.4
> /usr/local/share/perl/5.8.4 .).
> BEGIN failed--compilation aborted.
> 
> ... now the new version ...
> 
> steve@kirk:~/perl-current$ ./perl -I lib -MCarp -e1
> Too many open files.

I think I'd prefer the message to give some clue about what was up - maybe

  Can't locate Carp.pm - Too many open files.

Otherwise it will be really really hard to track down where the failure is
coming from.

Nicholas Clark

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About