[mrtg-developers] Re: fork problem with 2.10.8 and perl 5.6.0

Tobias Oetiker oetiker at ee.ethz.ch
Wed Dec 3 19:45:05 MET 2003


Today Larry Fahnoe wrote:

> Nope, some jobs run with 2, most with 8.

Larry,

can you try this:

--- mrtg~       Wed Dec  3 19:30:21 2003
+++ mrtg        Wed Dec  3 19:43:28 2003
@@ -2037,6 +2037,7 @@
                die sprintf("ERROR: select returned %d: $!\n", $nfound);
             }
            for (my $i = 0; $i < $forks; $i++) {
+                next unless defined $hand[$i] and defined fileno($hand[$i]);
                 if (vec($eout, fileno($hand[$i]), 1)) {
                   die "ERROR: fork $i has died ahead of time?\n";
                 }

my guess is that once the filehandle has been closed it will become
undefined ... I have not tested this patch ...

cheers
tobi

>
> On Wed, Dec 03, 2003 at 07:28:08PM +0100, Tobias Oetiker commenced mumbling:
> > Today Larry Fahnoe wrote:
> >
> > > This does not look to be a perl 5.6.0 issue.  To test this, I just
> > > grabbed the latest stable perl (5.8.2) and built & installed it under
> > > /usr/local.  I pointed mrtg at the new perl and continue to see the
> > > same warning messages.  Sorry, we can't blame this one on an old perl!
> >
> > are you running more thatn 32 forks ?
> >
> > tobi
> > >
> > >
> > > On Tue, Dec 02, 2003 at 11:31:37PM +0100, Tobias Oetiker commenced mumbling:
> > > > Today Larry Fahnoe wrote:
> > > >
> > > > > With the new fork code on a Red Hat 7.0 (2.2.24, perl 5.6.0) system
> > > > > I'm getting the following warnings:
> > > > >
> > > > >   Use of uninitialized value in vec at /usr/bin/mrtg line 2040.
> > > > >   Use of uninitialized value in vec at /usr/bin/mrtg line 2043.
> > > > >
> > > > > The two lines are:
> > > > >
> > > > >   2040: if (vec($eout, fileno($hand[$i]), 1)) {
> > > > >   2043: next unless vec($rout, fileno($hand[$i]), 1);
> > > > >
> > > > > Tobi has already cautioned me that the new forks code is not
> > > > > compatible with perl 5.6, but since I cannot easily upgrade perl on
> > > > > the system I use for mrtg, I thought I'd add a debug() line just
> > > > > before the first of the two vec() checks to see if I could spot the
> > > > > problem:
> > > > >
> > > > > +++ mrtg        Tue Dec  2 11:15:15 2003
> > > > > @@ -2037,6 +2037,7 @@
> > > > >                 die sprintf("ERROR: select returned %d: $!\n",
> > > > >                 $nfound);
> > > > >              }
> > > > >             for (my $i = 0; $i < $forks; $i++) {
> > > > > +               debug ('fork',"Check child $i");
> > > > >                  if (vec($eout, fileno($hand[$i]), 1)) {
> > > > >                    die "ERROR: fork $i has died ahead of time?\n";
> > > > >                  }
> > > > >
> > > > > The resulting debug output suggests that once the child has been read,
> > > > > it should not be read again.  After the first time the parent has read
> > > > > the child, subsequent calls to check on the child result in the
> > > > > uninitialized value warning.  Looks to me like the eout & rout
> > > > > filehandle vectors ought to be updated once the child has been read.
> > > > > However, since I'm not familiar with the guts of the processes, I'm
> > > > > not inclined to try to fix this.  Does the following output help
> > > > > someone who is qualified to fix it?
> > > >
> > > > Larry
> > > >
> > > > I have not looked into it yet,
> > > >
> > > > but the problem may be that perl before 5.8 was not realy able to
> > > > keep filehandles in scalar variables ($x) something like *x had to
> > > > be used ...
> > > >
> > > > I guess best would be if some perl 5.6 lover came up with a good
> > > > idea to 'fix' this cleanly ... one option would be to modify the
> > > > code so that it only uses the select approach in higher perl
> > > > versions ...
> > > >
> > > > cheers
> > > > tobi
> > > > >
> > > > >
> > > > > Tue Dec  2 11:20:00 CST 2003
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2041.
> > > > > Use of uninitialized value in vec at /usr/bin/mrtg line 2044.
> > > > >
> > > > >
> > > >
> > >
> > >
> >
>
>

-- 
 ______    __   _
/_  __/_  / /  (_) Oetiker @ ISG.EE, ETZ J97, ETH, CH-8092 Zurich
 / // _ \/ _ \/ /  System Manager, Time Lord, Coder, Designer, Coach
/_/ \.__/_.__/_/   http://people.ee.ethz.ch/~oetiker   +41(0)1-632-5286

--
Unsubscribe mailto:mrtg-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:mrtg-developers-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/mrtg-developers



More information about the mrtg-developers mailing list