[Numpy-tickets] [NumPy] #773: Valgrind causes some tests to fail

NumPy numpy-tickets@scipy....
Mon Mar 2 06:24:26 CST 2009


#773: Valgrind causes some tests to fail
-----------------------------+----------------------------------------------
 Reporter:  albertstrasheim  |        Owner:  somebody
     Type:  defect           |       Status:  new     
 Priority:  normal           |    Milestone:  1.3.0   
Component:  numpy.core       |      Version:  devel   
 Severity:  normal           |   Resolution:          
 Keywords:                   |  
-----------------------------+----------------------------------------------
Comment (by cdavid):

 We cannot do anything about it: valgrind does not emulate the FPU
 completely:

 {{{
 #!c
 #include <math.h>
 #include <fenv.h>
 #include <stdio.h>

 double divby(double x, double y)
 {
         return x/y;
 }

 int main()
 {
         int raised;
         double z;

         feclearexcept (FE_ALL_EXCEPT);
         z = divby(1., 0.);
         raised = fetestexcept (FE_OVERFLOW | FE_INVALID | FE_DIVBYZERO);
         printf("raised is %d\n", raised);
         if (raised & FE_OVERFLOW) {
                 printf("over\n");
         }
         if (raised & FE_INVALID) {
                 printf("invalid\n");
         }
         if (raised & FE_DIVBYZERO) {
                 printf("0 div\n");
         }

         return 0;
 }
 }}}

 You will get a divide by 0 exception when run normally, but the status is
 0 when run under valgrind.

-- 
Ticket URL: <http://scipy.org/scipy/numpy/ticket/773#comment:3>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list