From owner-freebsd-ports Mon Apr 24 23:45: 5 2000 Delivered-To: freebsd-ports@freebsd.org Received: from rye.elite.net (rye.elite.net [205.199.220.6]) by hub.freebsd.org (Postfix) with ESMTP id 3FB5737B92A; Mon, 24 Apr 2000 23:45:00 -0700 (PDT) (envelope-from nate@elite.net) Received: from almond.elite.net (root@almond.elite.net [205.199.220.5]) by rye.elite.net (8.9.3/8.9.3) with ESMTP id XAA90633; Mon, 24 Apr 2000 23:44:59 -0700 (PDT) Received: (nate@localhost) by almond.elite.net (8.8.3/8.6.12) id XAA13414; Mon, 24 Apr 2000 23:44:59 -0700 (PDT) Date: Mon, 24 Apr 2000 23:44:59 -0700 (PDT) From: Nate Lawson To: freebsd-hackers@freebsd.org Cc: freebsd-ports@freebsd.org, davidm@hpl.hp.com Subject: Re: floating point exceptions Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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. Is FreeBSD's behavior correct? Why or why not? You can use the included code snippet to verify that this occurs. Thanks, Nate ---------- Forwarded message ---------- Date: Mon, 24 Apr 2000 15:54:38 -0700 (PDT) From: David Mosberger To: Nate Lawson Subject: Re: patch to httperf-0.6 >>>>> On Mon, 24 Apr 2000 15:37:21 -0700 (PDT), Nate Lawson said: Nate> On x86. Your code generates SIGFPE, not SIGBUS sorry. Here Nate> is a code snippet which generates SIGFPE as well. Nate> main() { float a, b, c; Nate> a = 1.0; b = 0.0; c = a/b; } Nate> This seems to be correct behavior. No, IEEE says that the exceptions should be disabled by default. You should get Inf instead of SIGFPE. --david To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message