Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Feb 2000 07:39:20 +0100 (CET)
From:      Joakim Henriksson <murduth@ludd.luth.se>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/16740: Panic in CURRENT
Message-ID:  <200002160639.HAA01827@rmstar.campus.luth.se>

next in thread | raw e-mail | index | archive | help

>Number:         16740
>Category:       kern
>Synopsis:       The kernel panics with "ffs_clusteralloc: map mismatch"
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 15 22:40:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Joakim Henriksson
>Release:        FreeBSD-4.0
>Organization:
FreeBSD
>Environment:

uname -a
FreeBSD rmstar.campus.luth.se 4.0-CURRENT FreeBSD 4.0-CURRENT #4: Thu Jan 27 11:48:55 CET 2000     root@:/usr/src/sys/compile/RMSTAR.ata  i386


dmesg
Copyright (c) 1992-2000 The FreeBSD Project.
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California. All rights reserved.
FreeBSD 4.0-CURRENT #4: Thu Jan 27 11:48:55 CET 2000
    root@:/usr/src/sys/compile/RMSTAR.ata
Timecounter "i8254"  frequency 1193182 Hz
Timecounter "TSC"  frequency 400910829 Hz
CPU: AMD-K6(tm) 3D processor (400.91-MHz 586-class CPU)
  Origin = "AuthenticAMD"  Id = 0x58c  Stepping = 12
  Features=0x8021bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,PGE,MMX>
  AMD Features=0x80000800<SYSCALL,3DNow!>
real memory  = 134217728 (131072K bytes)
avail memory = 126951424 (123976K bytes)
Preloaded elf kernel "kernel" at 0xc0309000.
VESA: v2.0, 8192k memory, flags:0x1, mode table:0xc02b7382 (1000022)
VESA: Matrox Graphics Inc.
npx0: <math processor> on motherboard
npx0: INT 16 interface
pcib0: <VIA 82C598MVP (Apollo MVP3) host bridge> on motherboard
pci0: <PCI bus> on pcib0
pcib1: <VIA 82C598MVP (Apollo MVP3) PCI-PCI (AGP) bridge> at device 1.0 on pci0
pci1: <PCI bus> on pcib1
vga-pci0: <Matrox model 0521 graphics accelerator> mem 0xe5000000-0xe57fffff,0xe
4000000-0xe4003fff,0xe8000000-0xe8ffffff irq 9 at device 0.0 on pci1
isab0: <VIA 82C586 PCI-ISA bridge> at device 7.0 on pci0
isa0: <ISA bus> on isab0
ata-pci0: <VIA 82C586 ATA-33 controller> port 0x6400-0x640f at device 7.1 on pci
0
ata-pci0: Busmastering DMA supported
ata0 at 0x01f0 irq 14 on ata-pci0
ata1 at 0x0170 irq 15 on ata-pci0
ncr0: <ncr 53c810 fast10 scsi> port 0x6c00-0x6cff mem 0xea100000-0xea1000ff irq 
10 at device 10.0 on pci0
fxp0: <Intel EtherExpress Pro 10/100B Ethernet> port 0x7000-0x701f mem 0xea00000
0-0xea0fffff,0xea101000-0xea101fff irq 5 at device 11.0 on pci0
fxp0: Ethernet address 00:a0:c9:4b:cd:8c
atkbdc0: <keyboard controller (i8042)> at port 0x60-0x6f on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: model IntelliMouse, device ID 3
vga0: <Generic ISA VGA> at port 0x3b0-0x3df iomem 0xa0000-0xbffff on isa0
sc0: <System console> on isa0
sc0: VGA <16 virtual consoles, flags=0x200>
fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
fdc0: FIFO enabled, 8 bytes threshold
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A
pcm0: <CS423x> at port 0x534-0x537,0x388-0x38f,0x220-0x22f irq 7 drq 1,0 on isa0
unknown0: <GAME> at port 0x200-0x207 on isa0
unknown1: <CTRL> at port 0x120-0x127 on isa0
unknown2: <MPU> at port 0x330-0x331 irq 9 on isa0
Waiting 2 seconds for SCSI devices to settle
ad0: <IBM-DHEA-36480/HE8OA40> ATA-3 disk at ata0 as master
ad0: 6197MB (12692736 sectors), 12592 cyls, 16 heads, 63 S/T, 512 B/S
ad0: 16 secs/int, 1 depth queue, UDMA33
ad1: <Maxtor 91826U4/FA55048> ATA-5 disk at ata0 as slave 
ad1: 17418MB (35673120 sectors), 35390 cyls, 16 heads, 63 S/T, 512 B/S
ad1: 16 secs/int, 1 depth queue, UDMA33
ad2: <IBM-DJNA-371800/J78OA30> ATA-4 disk at ata1 as master
ad2: 17206MB (35239680 sectors), 34960 cyls, 16 heads, 63 S/T, 512 B/S
ad2: 16 secs/int, 32 depth queue, UDMA33
Mounting root from ufs:/dev/wd2a
cd0 at ncr0 bus 0 target 5 lun 0
cd0: <PIONEER DVD-ROM DVD-303 1.09> Removable CD-ROM SCSI-2 device 
cd0: 10.000MB/s transfers (10.000MHz, offset 8)
cd0: cd present [327597 x 2048 byte records]
cd1 at ncr0 bus 0 target 6 lun 0
cd1: <MATSHITA CD-R   CW-7502 4.10> Removable CD-ROM SCSI-2 device 
cd1: 10.000MB/s transfers (10.000MHz, offset 8)
cd1: Attempt to query device size failed: NOT READY, Medium not present - tray c
losed


disklabel ad2
# /dev/rad2c:
type: ESDI
disk: wd1s1
label: 
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 254
sectors/cylinder: 16002
cylinders: 2201
sectors/unit: 35236341
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0 

8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a:   409600        0    4.2BSD     1024  8192    16   # (Cyl.    0 - 25*)
  b:   614400   409600      swap                        # (Cyl.   25*- 63*)
  c: 35236341        0    unused        0     0         # (Cyl.    0 - 2201*)
  e: 34212341  1024000    4.2BSD     1024  8192    16   # (Cyl.   63*- 2201*)



newfs dump for the partition that causes the panic
newfs: /dev/wd1e: not a character-special device
Warning: 1548 sector(s) in last cylinder unallocated
/dev/wd1e:      34212340 sectors in 8353 cylinders of 1 tracks, 4096 sectors
        16705.2MB in 523 cyl groups (16 c/g, 32.00MB/g, 7936 i/g)
super-block backups (for fsck -b #) at:
 32, 65568, 131104, 196640, 262176, 327712, 393248, 458784, 524320, 589856,
 655392, 720928, 786464, 852000, 917536, 983072, 1048608, 1114144, 1179680,
 1245216, 1310752, 1376288, 1441824, 1507360, 1572896, 1638432, 1703968,
 1769504, 1835040, 1900576, 1966112, 2031648, 2097184, 2162720, 2228256,
 2293792, 2359328, 2424864, 2490400, 2555936, 2621472, 2687008, 2752544,
 2818080, 2883616, 2949152, 3014688, 3080224, 3145760, 3211296, 3276832,
 3342368, 3407904, 3473440, 3538976, 3604512, 3670048, 3735584, 3801120,
 3866656, 3932192, 3997728, 4063264, 4128800, 4194336, 4259872, 4325408,
 4390944, 4456480, 4522016, 4587552, 4653088, 4718624, 4784160, 4849696,
 4915232, 4980768, 5046304, 5111840, 5177376, 5242912, 5308448, 5373984,
 5439520, 5505056, 5570592, 5636128, 5701664, 5767200, 5832736, 5898272,
 5963808, 6029344, 6094880, 6160416, 6225952, 6291488, 6357024, 6422560,
 6488096, 6553632, 6619168, 6684704, 6750240, 6815776, 6881312, 6946848,
 7012384, 7077920, 7143456, 7208992, 7274528, 7340064, 7405600, 7471136,
 7536672, 7602208, 7667744, 7733280, 7798816, 7864352, 7929888, 7995424,
 8060960, 8126496, 8192032, 8257568, 8323104, 8388640, 8454176, 8519712,
 8585248, 8650784, 8716320, 8781856, 8847392, 8912928, 8978464, 9044000,
 9109536, 9175072, 9240608, 9306144, 9371680, 9437216, 9502752, 9568288,
 9633824, 9699360, 9764896, 9830432, 9895968, 9961504, 10027040, 10092576,
 10158112, 10223648, 10289184, 10354720, 10420256, 10485792, 10551328,
 10616864, 10682400, 10747936, 10813472, 10879008, 10944544, 11010080,
 11075616, 11141152, 11206688, 11272224, 11337760, 11403296, 11468832,
 11534368, 11599904, 11665440, 11730976, 11796512, 11862048, 11927584,
 11993120, 12058656, 12124192, 12189728, 12255264, 12320800, 12386336,
 12451872, 12517408, 12582944, 12648480, 12714016, 12779552, 12845088,
 12910624, 12976160, 13041696, 13107232, 13172768, 13238304, 13303840,
 13369376, 13434912, 13500448, 13565984, 13631520, 13697056, 13762592,
 13828128, 13893664, 13959200, 14024736, 14090272, 14155808, 14221344,
 14286880, 14352416, 14417952, 14483488, 14549024, 14614560, 14680096,
 14745632, 14811168, 14876704, 14942240, 15007776, 15073312, 15138848,
 15204384, 15269920, 15335456, 15400992, 15466528, 15532064, 15597600,
 15663136, 15728672, 15794208, 15859744, 15925280, 15990816, 16056352,
 16121888, 16187424, 16252960, 16318496, 16384032, 16449568, 16515104,
 16580640, 16646176, 16711712, 16777248, 16842784, 16908320, 16973856,
 17039392, 17104928, 17170464, 17236000, 17301536, 17367072, 17432608,
 17498144, 17563680, 17629216, 17694752, 17760288, 17825824, 17891360,
 17956896, 18022432, 18087968, 18153504, 18219040, 18284576, 18350112,
 18415648, 18481184, 18546720, 18612256, 18677792, 18743328, 18808864,
 18874400, 18939936, 19005472, 19071008, 19136544, 19202080, 19267616,
 19333152, 19398688, 19464224, 19529760, 19595296, 19660832, 19726368,
 19791904, 19857440, 19922976, 19988512, 20054048, 20119584, 20185120,
 20250656, 20316192, 20381728, 20447264, 20512800, 20578336, 20643872,
 20709408, 20774944, 20840480, 20906016, 20971552, 21037088, 21102624,
 21168160, 21233696, 21299232, 21364768, 21430304, 21495840, 21561376,
 21626912, 21692448, 21757984, 21823520, 21889056, 21954592, 22020128,
 22085664, 22151200, 22216736, 22282272, 22347808, 22413344, 22478880,
 22544416, 22609952, 22675488, 22741024, 22806560, 22872096, 22937632,
 23003168, 23068704, 23134240, 23199776, 23265312, 23330848, 23396384,
 23461920, 23527456, 23592992, 23658528, 23724064, 23789600, 23855136,
 23920672, 23986208, 24051744, 24117280, 24182816, 24248352, 24313888,
 24379424, 24444960, 24510496, 24576032, 24641568, 24707104, 24772640,
 24838176, 24903712, 24969248, 25034784, 25100320, 25165856, 25231392,
 25296928, 25362464, 25428000, 25493536, 25559072, 25624608, 25690144,
 25755680, 25821216, 25886752, 25952288, 26017824, 26083360, 26148896,
 26214432, 26279968, 26345504, 26411040, 26476576, 26542112, 26607648,
 26673184, 26738720, 26804256, 26869792, 26935328, 27000864, 27066400,
 27131936, 27197472, 27263008, 27328544, 27394080, 27459616, 27525152,
 27590688, 27656224, 27721760, 27787296, 27852832, 27918368, 27983904,
 28049440, 28114976, 28180512, 28246048, 28311584, 28377120, 28442656,
 28508192, 28573728, 28639264, 28704800, 28770336, 28835872, 28901408,
 28966944, 29032480, 29098016, 29163552, 29229088, 29294624, 29360160,
 29425696, 29491232, 29556768, 29622304, 29687840, 29753376, 29818912,
 29884448, 29949984, 30015520, 30081056, 30146592, 30212128, 30277664,
 30343200, 30408736, 30474272, 30539808, 30605344, 30670880, 30736416,
 30801952, 30867488, 30933024, 30998560, 31064096, 31129632, 31195168,
 31260704, 31326240, 31391776, 31457312, 31522848, 31588384, 31653920,
 31719456, 31784992, 31850528, 31916064, 31981600, 32047136, 32112672,
 32178208, 32243744, 32309280, 32374816, 32440352, 32505888, 32571424,
 32636960, 32702496, 32768032, 32833568, 32899104, 32964640, 33030176,
 33095712, 33161248, 33226784, 33292320, 33357856, 33423392, 33488928,
 33554464, 33620000, 33685536, 33751072, 33816608, 33882144, 33947680,
 34013216, 34078752, 34144288, 34209824



Some info from an earlier kernel that i could use gdb -k on. I can't seem 
to do anything usefu on recent kernels (or atleast the crashdumps that i've got
recently) although i do have a couple of crash dumps. I can still
do gdb -k on older kernels/crashdumps and the problem hasn't changed


The function that causes the panic is cluster_alloc() and the relevant part
is this:

        for (i = 1; i <= len; i++)
                if (!ffs_isblock(fs, cg_blksfree(cgp), got - run + i))
                        panic("ffs_clusteralloc: map mismatch");

IdlePTD 2981888
initial pcb at 261b80
panicstr: ffs_clusteralloc: map mismatch

(kgdb) bt
#0  0xc014a7bc in boot ()
#1  0xc014ab61 in panic ()
#2  0xc019d785 in ffs_clusteralloc ()
#3  0xc019c9d2 in ffs_hashalloc ()
#4  0xc019c34b in ffs_reallocblks ()
#5  0xc016fe7a in cluster_write ()
#6  0xc01a7dbe in ffs_write ()
#7  0xc017a025 in vn_write ()
#8  0xc015871d in dofilewrite ()
#9  0xc0158623 in write ()
#10 0xc01f547d in syscall ()
#11 0xc01e91c6 in Xint0x80_syscall ()
#12 0x43cecd in ?? ()
#13 0x43cb12 in ?? ()
and so on

#2  0xc019d785 in ffs_clusteralloc (ip=0xc0db0100, cg=116, bpref=3830648, 
    len=14) at ../../ufs/ffs/ffs_alloc.c:1179
1179                            panic("ffs_clusteralloc: map mismatch");
(kgdb) print *ip
$1 = {i_lock = {lk_interlock = {lock_data = 0}, lk_flags = 1024, 
    lk_sharecount = 0, lk_waitcount = 0, lk_exclusivecount = 1, lk_prio = 8, 
    lk_wmesg = 0xc022623a "inode", lk_timo = 0, lk_lockholder = 478}, 
  i_hash = {le_next = 0x0, le_prev = 0xc0b45d38}, i_vnode = 0xc8f5aa00, 
  i_devvp = 0xc83dbd40, i_flag = 143, i_dev = 0xc0b6be00, i_number = 809794, 
  i_effnlink = 1, inode_u = {fs = 0xc0b6a000, e2fs = 0xc0b6a000}, i_dquot = {
    0x0, 0x0}, i_modrev = 1759102206296, i_lockf = 0x0, i_count = 0, 
  i_endoff = 0, i_diroff = 0, i_offset = 0, i_ino = 0, i_reclen = 0, 
  i_spare = {0, 0, 0, 0}, i_din = {di_mode = 33188, di_nlink = 1, di_u = {
      oldids = {0, 0}, inumber = 0}, di_size = 196452352, 
    di_atime = 942168222, di_atimensec = 0, di_mtime = 942167624, 
    di_mtimensec = 0, di_ctime = 942167624, di_ctimensec = 0, di_db = {
      3363320, 3363328, 3363336, 3363344, 3363352, 3363360, 3363368, 3363376, 
      3363384, 3363392, 3363400, 3363408}, di_ib = {3797336, 3903352, 0}, 
    di_flags = 0, di_blocks = 383904, di_gen = 1801554013, di_uid = 0, 
(kgdb) print *fs
$3 = {fs_firstfield = 0, fs_unused_1 = 0, fs_sblkno = 16, fs_cblkno = 24, 
  fs_iblkno = 32, fs_dblkno = 1024, fs_cgoffset = 2048, fs_cgmask = -1, 
  fs_time = 942168235, fs_size = 17106170, fs_dsize = 16578961, fs_ncg = 523, 
  fs_bsize = 8192, fs_fsize = 1024, fs_frag = 8, fs_minfree = 8, 
  fs_rotdelay = 0, fs_rps = 60, fs_bmask = -8192, fs_fmask = -1024, 
  fs_bshift = 13, fs_fshift = 10, fs_maxcontig = 15, fs_maxbpg = 2048, 
  fs_fragshift = 3, fs_fsbtodb = 1, fs_sbsize = 2048, fs_csmask = -512, 
  fs_csshift = 9, fs_nindir = 2048, fs_inopb = 64, fs_nspf = 2, fs_optim = 0, 
  fs_npsect = 4096, fs_interleave = 1, fs_trackskew = 0, fs_id = {938721534, 
    1833775959}, fs_csaddr = 1024, fs_cssize = 9216, fs_cgsize = 6144, 
  fs_ntrak = 1, fs_nsect = 4096, fs_spc = 4096, fs_ncyl = 8353, fs_cpg = 16, 
  fs_ipg = 7936, fs_fpg = 32768, fs_cstotal = {cs_ndir = 24416, 
    cs_nbfree = 516378, cs_nifree = 3945722, cs_nffree = 63650}, 
  fs_fmod = 0 '\000', fs_clean = 0 '\000', fs_ronly = 0 '\000', 
  fs_flags = 2 '\002', fs_fsmnt = "/usr", '\000' <repeats 507 times>, 
  fs_cgrotor = 426, fs_csp = {0xc0b8a000, 0xc0b8c000, 0x0 <repeats 29 times>}, 
  fs_maxcluster = 0xc0b8c400, fs_cpc = 0, fs_opostbl = {{0, 0, 0, 0, 0, 0, 0, 
      0} <repeats 16 times>}, fs_sparecon = {0 <repeats 50 times>}, 
  fs_contigsumsize = 15, fs_maxsymlinklen = 60, fs_inodefmt = 2, 
  fs_maxfilesize = 8796093022207, fs_qbmask = 8191, fs_qfmask = 1023, 
  fs_state = 0, fs_postblformat = 1, fs_nrpos = 1, fs_postbloff = 0, 
  fs_rotbloff = 0, fs_magic = 72020, fs_space = ""}
(kgdb) print *cgp
$6 = {cg_firstfield = 0, cg_magic = 590421, cg_time = 942168235, cg_cgx = 116, 
  cg_ncyl = 16, cg_niblk = 7936, cg_ndblk = 32768, cg_cs = {cs_ndir = 50, 
    cs_nbfree = 373, cs_nifree = 7720, cs_nffree = 47}, cg_rotor = 29688, 
  cg_frotor = 29688, cg_irotor = 206, cg_frsum = {0, 2, 0, 0, 0, 1, 2, 4}, 
  cg_btotoff = 168, cg_boff = 232, cg_iusedoff = 264, cg_freeoff = 1256, 
  cg_nextfreeoff = 5924, cg_clustersumoff = 5348, cg_clusteroff = 5412, 
  cg_nclusterblks = 4096, cg_sparecon = {0 <repeats 13 times>}, 
  cg_space = "\001"}
(kgdb) print run
$7 = 14
(kgdb) 
(kgdb) print i  
$8 = 11
(kgdb) print got
$9 = 3786
(kgdb) 
(kgdb) print got - run + i
$10 = 3783
(kgdb) 


>Description:

When writing to disk the kernel sometimes panics. Either the kernel is in
error or newfs creates a bad filesystem.

>How-To-Repeat:

Write to the disk and you'll sooner or later trigger the bug.

>Fix:

Unknown


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200002160639.HAA01827>