From owner-freebsd-hackers Fri May 5 14:36:37 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from gilgamesch.bik-gmbh.de (T1-Hansenet.BIK-GmbH.de [192.76.134.246]) by hub.freebsd.org (Postfix) with ESMTP id B6F7737BC9E; Fri, 5 May 2000 14:36:30 -0700 (PDT) (envelope-from cracauer@gilgamesch.bik-gmbh.de) Received: (from cracauer@localhost) by gilgamesch.bik-gmbh.de (8.9.3/8.7.3) id XAA48419; Fri, 5 May 2000 23:35:53 +0200 (MET DST) Date: Fri, 5 May 2000 23:35:52 +0200 From: Martin Cracauer To: Nate Lawson Cc: freebsd-hackers@FreeBSD.ORG, freebsd-ports@FreeBSD.ORG, davidm@hpl.hp.com Subject: Re: floating point exceptions Message-ID: <20000505233552.A47008@cons.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: ; from nate@elite.net on Mon, Apr 24, 2000 at 11:44:59PM -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In , Nate Lawson wrote: > I am running FreeBSD 4.0-RELEASE on x86 with gcc 2.95.2 and the > httperf-0.6 port gives a SIGFPE and dumps core when run against a system > that has no web server running. (The default behavior is to measure > localhost when no arguments are specified). > > It seems this is caused by a divide by zero error since the delta between > connections ends up being zero. The author suggest that the divide > should return a defined value, Inf, according to the IEEE floating point > standard. FreeBSD generates SIGFPE. I temporarily patched the code > locally to check for a delta of zero and arbitrarily set it to 1.0 so > that the divide succeeds and everything comes out ok without crashing. FreeBSD up to 3.x defaults to have exceptions unmasked. This was changed before 4.0 and should be in 4.x/4-STABLE and in 5-current. Are you sure you get this on a real 4.0 system, not one from a few weeks before release? If so, what is the version of /usr/include/machine/npx.h? It should be 1.18. Of course, the kernel should be complied with it in case this is a source-updated system. Anyway, the solution is fpsetmask, as others noted. Also note that FreeBSD/gcc/ANSI C 89 have a few other problems with IEEE 754 compatibility so that we can't claim conformity in any case. Please check the mail archives on www.freebsd.org, this has been discussed every 7 months for the last 5 years now. Martin -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Martin Cracauer http://www.cons.org/cracauer/ BSD User Group Hamburg, Germany http://www.bsdhh.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message