Subject: bin/29151: fsck_lfs dumps core with assertion "bp->b_count == size"
To: None <,>
From: Pavel Cahyna <>
List: netbsd-bugs
Date: 01/28/2005 22:28:00
>Number:         29151
>Category:       bin
>Synopsis:       fsck_lfs dumps core with assertion "bp->b_count == size"
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 28 22:28:00 +0000 2005
>Originator:     Pavel Cahyna
>Release:        NetBSD 2.0_BETA i386

System: NetBSD 2.0_BETA (GENERIC_DIAGNOSTIC s patchem D. Reeda - PR#26839) #4: Wed Oct  6 10:13:10 CEST 2004


Today when browsing with mozilla (which have its cache on a LFS filesystem) the system got frozen.
X were completely dead, the machine answered pings but no ssh connectin to it was possible. Sometimes
I could hear some disk activity, but not constantly. After some time, I reset it. Then fsck complained:

fsck_lfs: Partial segment at 0x501800 data checksum mismatch: given 0xc45f, computed 0xf9d9

** /dev/rsd2h
** Last Mounted on 
** Phase 0 - Check Segment Summaries and Inode Free List
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Segment Block Accounting
** Phase 6 - Roll Forward

roll forward? [yn] 
** Phase 6b - Recheck Segment Block Accounting
avail given as 3083864, should be 3085912

fix? [yn] 
211225 files, 3741108 used, 3310559 free

WRITE CHANGES TO DISK? [yn] assertion "bp->b_bcount == size" failed: file "/autobuild/netbsd-2-0/src/sbin/fsck_lfs/bufcache.c", line 184, function "getblk"

fsck: /dev/rsd2h: Abort trap

# gdb /sbin/fsck_lfs /fsck_lfs.core
GNU gdb 5.3nb1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386--netbsdelf"...(no debugging symbols found)...
Core was generated by `fsck_lfs'.
Program terminated with signal 6, Aborted.

warning: current_sos: Can't read pathname for load map: Input/output error

Reading symbols from /lib/ debugging symbols found)...done.
Loaded symbols for /lib/
#0  0x48089fab in kill () from /lib/
(gdb) where
#0  0x48089fab in kill () from /lib/
#1  0x480fea87 in abort () from /lib/
#2  0x480d1356 in __assert13 () from /lib/
#3  0x08049467 in getblk ()
#4  0x08054053 in lfs_writeinode ()
#5  0x08055c82 in lfs_writevnodes ()
#6  0x08053d9b in lfs_segwrite ()
#7  0x08056d88 in ckfini ()
#8  0x0804e024 in checkfilesys ()
#9  0x0804de52 in main ()
#10 0x08048fc2 in ___start ()


unknown. The filesystem image and the core dump can be provided.