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

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

Thread Previous
From:
Steve Peters
Date:
September 28, 2005 07:56
Subject:
Re: [perl #33831] [PATCH] EMFILE misinterpretation
Message ID:
20050928145627.GB27126@mccoy.peters.homeunix.org
On Wed, Sep 28, 2005 at 12:38:06PM +0100, Nicholas Clark wrote:
> 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.
> 

Great!  Thanks for the hints, and I'll look into this patch further this
evening.

Steve Peters
steve@fisharerojo.org

Thread Previous


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