[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::digital_unix

Title:DIGITAL UNIX(FORMERLY KNOWN AS DEC OSF/1)
Notice:Welcome to the Digital UNIX Conference
Moderator:SMURF::DENHAM
Created:Thu Mar 16 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:10068
Total number of notes:35879

9718.0. "gethostbyname with greater than 1024 FDs" by SEAWLF::MCCLUNG () Mon May 05 1997 17:32

    A customer writes:
    
    I have run across a very peculiar situation in a program I am writing
    using Digital Unix 4.0A.  The situation is a follows:
    
    My program must connect to over 1024 processes via sockets.
    The config files for the program list the processes to connect to by
    machine name.  My program then goes through the lists specified
    in the config files and performs a gethostbyname() call on each
    machine name to obtain the value required for a connect().  If I
    allocate the file descriptor for each "remote" process as I go, then
    once I have used up 1024 file descriptors gethostbyname() becomes
    unstable and causes the program to core dump.  If I bypass the
    gethostbyname() call by pre-looking up all the machine names and
    using their dotted quad equivalents, the program executes correctly.
    Unfortunately, the "pre-lookup" work-around does not work for
    processes that need to be added dynamically (see below).
    
    I have checked the kernel and it is currently set to allow 4096 active
    file descriptor per process.  My select mask width is set to 2048.
    The test machine is an Alpha 333Mhz, with 256MB ram running
    4.0A.
    
    
    Does anyone have any suggestions?
    
    Joel McClung
    
T.RTitleUserPersonal
Name
DateLines
9718.1might be a bug?SMURF::DUSTINMon May 05 1997 18:239
    This sounds to me like it might be a bug in gethostbyname(), maybe
    it's not closing auxilary file descriptors used for remote name
    lookups (NIS, Bind)?
    
    I'd file a QAR, especially since it works one way and not the
    other (ie. it sounds like it may be a bug in the library code).
    
    John