NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-i386/43655 (integer division by zero delivers SIGFPE with wrong siginfo code on i386)



The following reply was made to PR port-i386/43655; it has been noted by GNATS.

From: christos%zoulas.com@localhost (Christos Zoulas)
To: gnats-bugs%NetBSD.org@localhost, port-i386-maintainer%netbsd.org@localhost, 
        gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost, 
        Taylor R Campbell <campbell+netbsd%mumble.net@localhost>
Cc: 
Subject: Re: port-i386/43655 (integer division by zero delivers SIGFPE with 
wrong siginfo code on i386)
Date: Sat, 24 Jul 2010 11:34:15 -0400

 On Jul 23,  3:15pm, campbell+netbsd%mumble.net@localhost (Taylor R Campbell) 
wrote:
 -- Subject: Re: port-i386/43655 (integer division by zero delivers SIGFPE wit
 
 |  I'm cc'ing port-i386-maintainer because it looks like amd64 has the
 |  same problem, from this snippet in amd64/amd64/trap.c:
 |  
 |                  case T_DIVIDE|T_USER:
 |                          ksi.ksi_code = FPE_FLTDIV;
 |  
 |  T_DIVIDE is the code delivered by trap 0 in amd64/amd64/vector.S,
 |  which is the trap for integer division by zero.  I think changing that
 |  and the analogous line in i386/i386/trap.c to use FPE_INTDIV should
 |  fix the problem, but I haven't tested to confirm this.  FPE_FLTDIV is
 |  delivered for floating-point division by zero separately, in
 |  i386/isa/npx.c for i386 and in amd64/amd64/fpu.c for amd64.
 |  
 |  Nearby in both trap.c files is FPE_FLTOVF for integer overflow (traps
 |  4 and 5), and, in i386/i386/trap.c, FPE_INTOVF for FPU exceptions
 |  (trap #x10, in what seems to be an unusual case, when NNPX = 0).  This
 |  code needs to exchange some INTs and FLTs, methinks.
 
 I am on it.
 
 christos
 


Home | Main Index | Thread Index | Old Index