Subject: Integer divide fault trap in _readdiskla
To: 'SMTP:port-i386@NetBSD.ORG' <port-i386@NetBSD.ORG>
From: OTT) <Brian_de_Alwis@oti.com (Brian de Alwis>
List: port-i386
Date: 07/11/1996 10:20:23
I get the above fault with recent -current kernels. Here's the output on 
screen:

    [...]
    wdc0 at isa0 port 0x1f0-0x1f7 irq 14
    wd0 at wdc0 drive 0: 100MB, 868 cyl, 7 head, 34 sec, 512 bytes/sec 
<OR0300>
    wd0: usng 1-sector 16-bit pio transfers, chs addressing
    wd1 at wdc0 drive 1: 240MB, 937 cyl, 15 head, 35 sec, 512 bytes/sec 
<SAMSUNG    SHD-3122A (APOLLO)>
    wd1: usng 1-sector 16-bit pio transfers, chs addressing
    [...]

    Automatic boot in progress: starting file system checks.
    /dev/wd0a: file system is clean; not checking
    wd0: wdcintr: read intr before drq: status 0 error 0
    kernel: integer divide fault trap, code = 0
    Stopped at       _readdisklabel + 0xc5:    divl 0x38(%ecx), %eax
    db>

I can usually get past this after several reboots. It also works fine if I 
boot into single-user mode, mount the drives manually, and then resume 
multi-user mode.

This is present in the June 26 snapshot, although it was also present in 
 -current from around April 15th or so. I didn't have this problem before 
then, although I was then running -current from late 1995.

I tracked it down a bit in April, but ran out of time (exams and 
graduation)... My memory of  this is scetchy, but I decided it must be a 
timing error. A structure ('lp'?) being passed to _readdisklabel had all 
values set to zero. Putting a printf() for 'lp->d_secpercyl' in 
_readdisklabel helped greatly.


 --
Brian de Alwis = Brian_de_Alwis@oti.com, bsdealwis@uwaterloo.ca
     Software Engineer at Object Technology Int'l = |-@
 "Maybe this world is another planet's Hell." - Aldous Huxley