Amanda-Users

amstatus bug

2003-02-07 05:41:29
Subject: amstatus bug
From: Todd Lyons <todd AT mrball DOT net>
To: amanda-users AT amanda DOT org
Date: Fri, 7 Feb 2003 02:02:35 -0800
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have a machine that I have several directories I'm backing up.  Most
are small, but a couple are large.  The two largest ones are both bigger
than the holding disk.  For those two, amstatus prints out some perl
errors:  (edited for length)

bash-2.05$ amstatus DB
Using /var/lib/amanda/DB/amdump from Fri Feb  7 01:46:43 PST 2003

db:/etc                   0     800k finished (1:50:35)
db:/home                  0   15160k finished (1:52:03)
<snip>
db:/var/databases/calendar 0       3k finished (1:48:33)
db:/var/databases/develop 0      49k finished (1:49:49)
Use of uninitialized value in printf at /usr/sbin/amstatus line 760.
Use of uninitialized value in numeric ne (!=) at /usr/sbin/amstatus line
761.
db:/var/databases/dq      0 1410610k dumping        0k
(1:54:27)
Use of uninitialized value in addition (+) at /usr/sbin/amstatus line
770.

I haven't had a chance to dig into the logic yet, and I'm going to Vegas
tomorrow morning.  A good present would be to get home and find someone
figured this out for me :)

The code in question is this:
    elsif($dump_started{$hostpart} == 1 &&
        $dump_finished{$hostpart} != 1) {
        if( defined $opt_dumping ) {
            printf "%-40s%2d", "$host:$partition", $level{$hostpart};
            printf "%8dk", $esize{$hostpart};
            printf " dumping %8dk", $size{$hostpart};
            if($size{$hostpart} != 0) {
                printf " (%6.2f%%)", (100.0*$size{$hostpart})/$esize{$hostpart};
            }
            if( defined
$starttime ) {
                print "(", &showtime($dump_time{$hostpart}), ")";
            }
            print "\n";
        }
        $dupartition++;
        $dusize += $size{$hostpart};
        $duesize += $esize{$hostpart};
    }

Every line with "$size{$hostpart}" is what it's complaining about.
Looking earlier in the file I can see where the logic is at work to
decide when to set $size{$hostpart} (which implicitly declares it), but
didn't sit down long enough to try and figure out the flaw in the logic.
My gut reaction is that this particular dump target is larger than the
holding disk or that the dump target produces a value larger than the
regex is designed to handle (but the latter seems a little less likely
than the former).
- -- 
Blue skies...   Todd    Public key: http://www.mrball.net/todd.asc
We're sysadmins.  To us, data is a protocol overhead.  --Mans Nilsson
   Linux kernel 2.4.19-16mdk   3 users,  load average: 0.01, 0.01, 0.00
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+Q4Q7IBT1264ScBURAg9OAJ9okCe/+lpnrJ7L4tCe3rVBgt6slgCgv6o7
1My03Rbthz+fpzBsa+q1g2k=
=C54p
-----END PGP SIGNATURE-----

<Prev in Thread] Current Thread [Next in Thread>
  • amstatus bug, Todd Lyons <=