Subject: More on [r]dump
To: None <netbsd-bugs@sun-lamp.cs.berkeley.edu>
From: Havard Eidnes <Havard.Eidnes@runit.sintef.no>
List: netbsd-bugs
Date: 11/17/1993 17:02:55
Uhn, I forgot to do include the obj/ directory in the debug startup...

Anyway, here's more on the rdump problem:

(gdb) run 6bsdf 126 45000 6000 skarv.uninett.no:/dev/rmt/0mn /usr
Starting program: /usr/src/sbin/dump/obj/rdump 6bsdf 126 45000 6000 skarv.uninett.no:/dev/rmt/0mn /usr
  DUMP: Date of this level 6 dump: Wed Nov 17 16:50:12 1993
  DUMP: Date of last level 0 dump: Mon Nov  8 20:20:19 1993
  DUMP: Dumping /dev/rwd0f (/usr) to /dev/rmt/0mn on host skarv.uninett.no
  DUMP: mapping (Pass I) [regular files]

Program received signal 11, Segmentation fault
Reading in symbols for /usr/src/sbin/dump/dumptraverse.c...done.
0x4ee5 in mapfiles (maxino=0x000104ff, tapesize=(int *) 0x2b3f0) (/usr/src/sbin/dump/dumptraverse.c line 114)
114                     SETINO(ino, usedinomap);
(gdb) where
#0  0x4ee5 in mapfiles (maxino=0x000104ff, tapesize=(int *) 0x2b3f0) (/usr/src/sbin/dump/dumptraverse.c line 114)
#1  0x27a1 in main (...)
(gdb) l
109
110             for (ino = 0; ino <= maxino; ino++) {
111                     dp = getino(ino);
112                     if ((mode = (dp->di_mode & IFMT)) == 0)
113                             continue;
114                     SETINO(ino, usedinomap);
115                     if (mode == IFDIR)
116                             SETINO(ino, dumpdirmap);
117                     if (dp->di_mtime >= spcl.c_ddate ||
118                         dp->di_ctime >= spcl.c_ddate) {
(gdb) p ino
$1 = 0x00000000
(gdb) p usedinomap
$2 = (char *) 0x2c000 
(gdb) p mode
$3 = 61440
(gdb) p dp
$4 = (struct dinode *) 0x23b00
(gdb) 

Is it supposed to start at 0 and not 1?  It's SETINO that fails:

#define SETINO(ino, map) \
        map[(u_int)((ino) - 1) / NBBY] |=  1 << ((u_int)((ino) - 1) % NBBY)

and as far as I can see, with "ino" set to 0 this will index out of map's
bounds (?)

Anyway, modifying 0 to 1 in the for loop seems to have made rdump work
again on this particular file system.


- Havard

------------------------------------------------------------------------------