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

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

Thread Next
July 18, 2003 12:50
[perl #23042] solaris open file descriptor recursive lib loading error.
Message ID:
# New Ticket Created by 
# Please include the string:  [perl #23042]
# in the subject line of all future correspondence about this issue. 
# <URL: >

This is a bug report for perl from,
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 "";
} elsif ( $load == 2 ) {
    print "loading 2 libs.\n";
    require "";
    require "";
} elsif ( $load == 3 ) {
    print "loading 1 lib, which loads 2 libs\n";
    require "";
} else {
    print "invalid load (-l) \n";


print "Cleaning up...";
foreach (0 .. $max) {
    print `rm aa*`;
print "\n";

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

print "fhtestlib loaded.\n";


package fhtestlib2;

print "fhtestlib2 loaded\n";


package fhtestlib3;

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

print "fhtestlib3 loaded.\n";


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 ;)


[Please do not change anything below this line]
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:
    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
    cc='cc', ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    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/, so=so, useshrplib=false, libperl=libperl.a
  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:

Environment for perl v5.8.0:
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About