Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: john@iastate.edu (John Hascall)
Subject: Re: Digital Unix - rexec() problems
Date: 1998/02/08	[thread overview]
Message-ID: <6bjfr3$th$1@news.iastate.edu> (raw)
In-Reply-To: 34d844c3.11215802@personalnews.germany.eu.net


Anita Hegerlend <foo@bar.com> wrote:
}I'm writing a program that executes other programs on a number of
}machines in the net. For that purpose I use the rexec() call that
}reports a socket descriptor from that I can read the outputs of the
}remotely started program and close the descriptor afterwards. In case
}that a machine cannot be reached, e.g. is switched off, the respective
}socket descriptor "gets lost" because a -1 (and no descriptor) is
}reported in order to report a problem. The outputs of the function
}(which is called within a pthread) show, that a descriptor that could
}have been used for testing the existence of an unreacheable host is
}not used anymore. Because there are other parts of the software coming
}from other developers who can read and write files at any time I am
}not able to close a descriptor on suspect. The problem is critical
}because I loose about 1000 descriptors per day and UNIX has only about
}4000 descriptors at most in stock for a process. This resolves in a
}crash every 4 days and the program is intended to run over weeks.

   You are correct, there is a descriptor leak in this case.
   Here's a 'trace' of a program calling just rexec():

stat ("/etc/svc.conf", 0x11fffd580) = 0
  [ , <8.0.977 -rw-rw-r-- 1 root system 20 45 886914675,879028919,879028919> ]
             :
             :
socket (AF_INET,STREAM,PF_UNSPEC) = 5
connect (5, 0x11fffd6c0=<2/INET, 59139, 129.186.140.50>, 16) =  -1,
  (Connection refused)
close (5) = 0
gettimeofday (0x11fffd5d0, 0x0) = 0
usleep_thread () = 0
gettimeofday (0x11fffd5d0, 0x0) = 0
             :
socket (AF_INET,STREAM,PF_UNSPEC) = 5
connect (5, 0x11fffd6c0=<2/INET, 59139, 129.186.140.50>, 16) =  -1,
  (Connection refused)
close (5) = 0
gettimeofday (0x11fffd5d0, 0x0) = 0
usleep_thread () = 0
gettimeofday (0x11fffd5d0, 0x0) = 0
socket (AF_INET,STREAM,PF_UNSPEC) = 5
connect (5, 0x11fffd6c0=<2/INET, 59139, 129.186.140.50>, 16) =  -1,
  (Connection refused)
                             <=== NOTE, no "close(5)" here!
getuid () = 129
open ("/usr/lib/nls/msg/C/libc.cat", O_RDONLY, 020002625670) = -1
  (No such file or directory)
getuid () = 129
open ("libc.cat", O_RDONLY, 020002625670) = -1
  (No such file or directory)
write (2, "tigger.cc.iastate.edu", 21) = 21
write (2, ": ", 2) = 2
write (2, "Connection refused", 18) = 18
write (2, <0a>, 1) = 1

   After the last connect attempt, the socket was not closed
   (my test done under Digital UNIX V4.0B  (Rev. 564)).


John
-- 
John Hascall, Software Engr.        Shut up, be happy.  The conveniences you
ISU Computation Center              demanded are now mandatory. -Jello Biafra
mailto:john@iastate.edu
http://www.cc.iastate.edu/staff/systems/john/welcome.html  <-- the usual crud



      reply	other threads:[~1998-02-08  5:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-02-04  5:00 Digital Unix - rexec() problems Anita Hegerlend
1998-02-08  5:00 ` John Hascall [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox