From owner-freebsd-current Tue Aug 25 07:39:16 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA06190 for freebsd-current-outgoing; Tue, 25 Aug 1998 07:39:16 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from gilgamesch.bik-gmbh.de (gilgamesch.bik-gmbh.de [194.233.237.91]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA06163 for ; Tue, 25 Aug 1998 07:39:11 -0700 (PDT) (envelope-from cracauer@gilgamesch.bik-gmbh.de) Received: (from cracauer@localhost) by gilgamesch.bik-gmbh.de (8.8.8/8.7.3) id QAA09189; Tue, 25 Aug 1998 16:38:13 +0200 (MET DST) Message-ID: <19980825163812.A9088@cons.org> Date: Tue, 25 Aug 1998 16:38:12 +0200 From: Martin Cracauer To: Stephen Hocking-Senior Programmer PGS Tensor Perth , current@FreeBSD.ORG Subject: Re: Floating Point Exceptions, signal handlers & subsequent ops References: <199808250753.PAA29567@ariadne.tensor.pgs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.1i In-Reply-To: <199808250753.PAA29567@ariadne.tensor.pgs.com>; from Stephen Hocking-Senior Programmer PGS Tensor Perth on Tue, Aug 25, 1998 at 03:53:48PM +0800 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In <199808250753.PAA29567@ariadne.tensor.pgs.com>, Stephen Hocking-Senior Programmer PGS Tensor Perth wrote: > > I've noticed in one of my applications that the first FP operation after > return from a caught SIGFPE is invalid. I have a signal handler installed that > just prints out some basic info (like "SIGFPE caught"). The first FP op after > this (in my case, converting a long to a double) just gives garbage. Repeat > the same statement and it gives a sensible result. Has anyone else seen this > before I file a PR with code to reproduce the problem? Are you sure your signal handler doesn't do anything it shouldn't? For example, printf causes manipulation of FP flags and these affect the operation that may be in progress in your main code path. ANSI C just allows manipulation of 'volatile sig_atomic_t' variables. Posix adds many systems calls (amoung them read/write), but most C library stuff isn't suported. Please post a working example or at least your signal handler. 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-current" in the body of the message