Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 May 1999 03:43:03 +1000
From:      Bruce Evans <bde@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
Message-ID:  <199905011743.DAA03750@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>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 <signal.h>

	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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199905011743.DAA03750>