develooper Front page | perl.perl5.porters | Postings from July 2003

[perl #23042] solaris open file descriptor recursive lib loading error.

Thread Next
From:
perlbug-followup
Date:
July 18, 2003 12:50
Subject:
[perl #23042] solaris open file descriptor recursive lib loading error.
Message ID:
rt-23042-61334.4.07825839686623@rt.perl.org
# New Ticket Created by  craig@malchiarts.com 
# Please include the string:  [perl #23042]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=23042 >



This is a bug report for perl from craig@malchiarts.com,
generated with the help of perlbug 1.34 running under perl v5.8.0.


-----------------------------------------------------------------
[Please enter your report here]

Solaris has a known issue with open file descriptors, but the error message
thrown when the limit has been reached by loading a lib is misleading.  Also,
recursive library calls (libA calls libB calls libC etc...) generate the same
error message.

use program below for reference:

#!/usr/bin/perl -w

use lib ".";
use IO::File;
use strict;
use Getopt::Long;

my @files;
my $load = 1;
my $max = 251;

GetOptions( "load|l=s" => \$load,
                "max|m=s" => \$max
         );

print "Opening files... ";
foreach (0..$max) {
    push @files, IO::File->new(">aa$_");
}
print "count: " . scalar(@files) ."\n";

if ( $load == 1 ) {
    print "loading 1 lib.\n";
    require "fhtestlib.pm";
} elsif ( $load == 2 ) {
    print "loading 2 libs.\n";
    require "fhtestlib.pm";
    require "fhtestlib2.pm";
} elsif ( $load == 3 ) {
    print "loading 1 lib, which loads 2 libs\n";
    require "fhtestlib3.pm";
} else {
    print "invalid load (-l) \n";

}


print "Cleaning up...";
foreach (0 .. $max) {
    $files[$_]->close();
}
    print `rm aa*`;
print "\n";
1;

## put these packages in separate files ##
package fhtestlib;


print "fhtestlib loaded.\n";

1;

package fhtestlib2;

print "fhtestlib2 loaded\n";

1;

package fhtestlib3;

use lib ".";
use fhtestlib;
use fhtestlib2;

print "fhtestlib3 loaded.\n";

1;


also note that adding a -m switch greater than the accepted amount will not
cause an error. (ie: -m 400) until something is attempted to be done with the
file handle.  (I don't know if that's an IO::File bug or no...).

I suppose it's not such a big deal, but it's come up twice at work... first
time took some time to figure it out...

(note:  below site configuration is *not* where I'm having the problem ;)

-craig


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
Site configuration information for perl v5.8.0:

Configured by root at Thu Feb 27 12:12:44 PST 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.4.20, archname=i386-linux
    uname='linux midas 2.4.20 #4 sat feb 22 18:47:21 pst 2003 i686 unknown '
    config_args='-de -Dprefix=/usr -Dcccdlflags=-fPIC -Darchname=i386-linux'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O3',
    cppflags='-fno-strict-aliasing'
    ccversion='', gccversion='3.2.2', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
    libc=/lib/libc-2.3.1.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.3.1'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl v5.8.0:
    /usr/lib/perl5/5.8.0/i386-linux
    /usr/lib/perl5/5.8.0
    /usr/lib/perl5/site_perl/5.8.0/i386-linux
    /usr/lib/perl5/site_perl/5.8.0
    /usr/lib/perl5/site_perl
    .

---
Environment for perl v5.8.0:
    HOME=/usr/home/craig
    LANG=C
    LANGUAGE (unset)
    LC_ALL=POSIX
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/opt/kde/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/usr/lib/qt-3.1.2/bin:/usr/share/texmf/bin:.
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh


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