[NumPy-Tickets] [NumPy] #2206: Floating point string conversions corrupted when using SSE2

NumPy Trac numpy-tickets@scipy....
Thu Aug 23 15:34:18 CDT 2012


#2206: Floating point string conversions corrupted when using SSE2
---------------------------------------------------------------+------------
 Reporter:  ekvamme                                            |       Owner:  pv         
     Type:  defect                                             |      Status:  new        
 Priority:  normal                                             |   Milestone:  Unscheduled
Component:  numpy.linalg                                       |     Version:  1.6.2      
 Keywords:  linalg, sse2, python2.7, "ERR", string conversion  |  
---------------------------------------------------------------+------------
 After running numpy.linalg functions, string conversions using str() on
 some small floating point numbers are corrupted and return “ERR”.  This
 bug occurs with all versions of Numpy win32 for Python2.7 with all
 releases of Python 2.7. It only occurs with Numpy sse2 architecture
 enabled and does not occur with "nosse" or "sse3".  It was seen first on
 an older Pentum that only supported up to sse2 so it was the default Numpy
 installation architecture but the same failure is observed on any newer
 systems by using the /arch sse2 argument when installing Numpy.  On an
 older system that has only up to sse2 support, the error is avoided by
 installing Numpy with the /arch nosse argument.
 A test script that demonstrates the  error is as follows:
 -------------------
 # Demonstrate fail in numpy for Python 2.7 when installed with SSE2
 support (/arch sse2)

 import numpy

 z = numpy.array([[15,0,672],[0,400,36],[0,0,1]])

 beforestr = str(1e-12)

 numpy.linalg.inv(z)  # This causes second str() to return a different
 result

 afterstr = str(1e-12)

 if beforestr != afterstr:
     print "FAIL =", beforestr, afterstr
 else:
     print "PASS"
 raw_input("Press any key to continue")

 ----------------------------
 This has been shown to fail with the following versions: Python 2.7.3 with
 Numpy 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, and 1.7.0b1 and Python 2.7 with
 Numpy 1.5.0 (just to show all versions from the earliest releases of both
 Python 2.7 and Numpy for 2.7 fail). This error does not occur with Numpy
 win32 for Python2.5.  The versions tried were Python 2.5.4 with Numpy
 1.0.4, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.3.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0,
 1.6.1, 1.6.2, and 1.7.0b1.

 While the observation of the error has only been clearly observed on the
 string conversion of a float after running linalg, the concern is that
 other floating point computation problems may be generated by this but I
 have not discovered them yet.

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/2206>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list