[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#339318: Bug in fesetenv() [LIBC6.1]



Package:	libc6.1
Version:	2.2.5-11.5

Summary:	Under some circumstances, invoking fesetenv() results
		in a floating point exception being raised.

Description:

I have a piece of code which may result in underflows. I enclose
the code in between

	fenv_t env;
	feholdexcept(&env);

	...

	fesetenv(&env);

Now the code in [...] is reading floating point numbers which may
be very small and result in underflow floating point signals.
However, since we have used feholdexcept() the signals should not
be produced. And indeed they are not, until we reach fesetenv()
where the signal is raised.

If you read the manual of LIBC for fesetenv()

       The fesetenv function restores the floating point environ-
       ment  from the object *envp.  This object must be known to
       be valid, e.g., the  result  of  a  call  to  fegetenv  or
       feholdexcept  or  equal to FE_DFL_ENV.  This call does not
       raise exceptions.

it says no exception should be raised.






Reply to: