Subject: Re: reproduceable "integer divide fault trap"
To: None <netbsd-help@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: netbsd-help
Date: 11/27/2005 01:32:43
In article <20051127011455.GA23332@vergon.kollasch.net>,
Jonathan A. Kollasch <jakllsch@kollasch.net> wrote:
>-=-=-=-=-=-
>
>kernel: integer divide fault trap, code=0
>Stopped in pid 4445.1 (mkdir) at netbsd:__qdivrem+0x3b: divl %ecx,%eax
>db> bt
>__qdivrem(109e0000,0,0,0,0) at netbsd:__qdivrem+0x3b
>__divdi3(ef620000,ffffffff,0,0,0) at netbsd:__divdi3+0x29
>ffs_dirpref(cca46218,c1875c00,c0336926,cc7ef540) at netbsd:ffs_dirpref+0x170
>ffs_valloc(...
>VOP_VALLOC(...
>ufs_mkdir(...
>VOP_MKDIR(...
>sys_mkdir(...
>syscall_plain()
>--- syscall (number 136) ---
>0x480e3b8f:
>db> 
>
>I'm not an expert programmer, so could someone tell me if the
>arguments given to qdivrem would cause the code in sys/lib/libkern/qdivrem.c
>to do naughty math. The area around line 91 looks suspicious.

Add some printf's in ffs_alloc.c:ffs_dirpref to see what causes the zerodivide.

christos