On Fri, 13 Jul 2007, Otto Moerbeek wrote:

> On Fri, 13 Jul 2007, Marcos Laufer wrote:
> 
> > Otto ,
> > 
> > This is the error i get:
> > It starts booting , and it starts fsck , it fails with /dev/rwd0e and rwd0h,
> > 
> > (i could see once that when it finished it says:)
> > fsck_ffs in free():  error: free_page: pointer to wrong page
> > fsck: /dev/rwd0h: Abort trap
> > 
> > I reboot it again many times and that did not show again
> > 
> > 
> > i try to fsck manually like this as you say and i get:
> > 
> > # ulimit -d unlimited
> > # fsck -y /dev/rwd0e
> > 
> > INCONSISTENT CGSIZE=16384
> > 
> > FIX? yes
> > 
> > * * Last mounted on /usr
> > * * Phase 1- Check Blocks and Sizes
> > * * Phase 2 - Check pathnames
> > * * Phase 3 - Check Conectivity
> > * * Phase 4 - Check Reference Counts
> > * * Phase 5 - Check Cyl Groups
> > 
> > CANNOT READ: BLK 64
> > 
> > CONTINUE? yes
> > 
> > fsck: /dev/rwd0e: Segmentation Fault
> 
> This is not an out of memory situation.
> 
> It looks like fsck_ffs has problems getting data from your disk,
> probably because of hardware failure or bad cabling.  Sometimes it
> detects it cannot read the data (the CANNOT READ: BLK 64 case), but it
> is possible it gets corrupted data in other cases. 
> 
> Sadly, this can cause fsck_ffs to do the wrong thing and access wrong
> memory and corrupt it's internal data. During the last year I've fixed
> some stuff in this area, but there still remains cases that can go
> wrong.

I misdiagnosed the problem. In the meantime I got another report with
a dd of the partition which enabled me to diagnose the problem and
make a fix for 4.1. Please test and report back. I'll be on vacation
from Saturday, so it would be nice if you can answer before that. 

Anobody else seeing INCONSISTENT CGSIZE messages should try this as well.

NOTE: this diff only applies to 4.1. Current does not have the
problem, due to a corrected CGSIZE macro.

        -Otto

Index: setup.c
===================================================================
RCS file: /cvs/src/sbin/fsck_ffs/setup.c,v
retrieving revision 1.29
diff -u -p -r1.29 setup.c
--- setup.c     16 Feb 2007 08:34:29 -0000      1.29
+++ setup.c     19 Jul 2007 18:02:36 -0000
@@ -336,6 +336,7 @@ setup(char *dev)
                sbdirty();
                dirty(&asblk);
        }
+#if 0
        if (sblock.fs_cgsize != fragroundup(&sblock, CGSIZE(&sblock))) {
                pwarn("INCONSISTENT CGSIZE=%d\n", sblock.fs_cgsize);
                sblock.fs_cgsize = fragroundup(&sblock, CGSIZE(&sblock));
@@ -346,6 +347,7 @@ setup(char *dev)
                        dirty(&asblk);
                }
        }
+#endif
        if (INOPB(&sblock) != sblock.fs_bsize / sizeof(struct ufs1_dinode)) {
                pwarn("INCONSISTENT INOPB=%d\n", INOPB(&sblock));
                sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs1_dinode);

Reply via email to