From owner-freebsd-bugs Sat May 1 10:43:28 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.26.10.9]) by hub.freebsd.org (Postfix) with ESMTP id 431DA14FB7; Sat, 1 May 1999 10:43:16 -0700 (PDT) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id DAA03750; Sun, 2 May 1999 03:43:03 +1000 Date: Sun, 2 May 1999 03:43:03 +1000 From: Bruce Evans Message-Id: <199905011743.DAA03750@godzilla.zeta.org.au> To: cracauer@cons.org, freebsd-bugs@FreeBSD.ORG, steve@FreeBSD.ORG Subject: Re: kern/2142: FP mask not saved for signal handlers Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Synopsis: FP mask not saved for signal handlers > >State-Changed-From-To: suspended->closed >State-Changed-By: steve >State-Changed-When: Sat May 1 08:22:00 PDT 1999 >State-Changed-Why: >kris@freebsd.org noticed this was 'suspended' and not in the 'closed' state >as suggested in the audit trail. Attempting to fix it now. The original >message from Martin was as follows: > >Closing my own old bug report, submitted back when I didn't know what >is allowed to do in an ANSI C signal handler. You are allowed to do silly things like: #include volatile sig_atomic_t foo; void handler(int signo) { volatile double x = 1, y = 3, z = 1.0 / 3.0; foo = (y * z == x); } This does floating point computations in a signal handler and doesn't have any side effects except the one permitted by ANSI (assigning a value to an object declared as volatile_sig_atomic_t). The volatile doubles just prevent some of the floating point computations being optimised away. This shows that the FP state needs to be preserved by signal handlers. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message