[pypy-svn] r61701 - in pypy/trunk/pypy: module/_rawffi/test rlib/test

afa at codespeak.net afa at codespeak.net
Tue Feb 10 18:05:20 CET 2009


Author: afa
Date: Tue Feb 10 18:05:18 2009
New Revision: 61701

Modified:
   pypy/trunk/pypy/module/_rawffi/test/test__rawffi.py
   pypy/trunk/pypy/rlib/test/test_libffi.py
Log:
Skip libffi structure tests which segfaults on x86_64 processors.

On these machines, small structures (<=16 bytes) may be passed in registers
if all their members are "simple enough" (no long double for example)

To check this, the libffi library needs to iterate over the elements of the structure,
but we never fill the 'c_elements' member :-(


Modified: pypy/trunk/pypy/module/_rawffi/test/test__rawffi.py
==============================================================================
--- pypy/trunk/pypy/module/_rawffi/test/test__rawffi.py	(original)
+++ pypy/trunk/pypy/module/_rawffi/test/test__rawffi.py	Tue Feb 10 18:05:18 2009
@@ -735,7 +735,12 @@
         raises(_rawffi.SegfaultException, a.__setitem__, 3, 3)
 
     def test_struct_byvalue(self):
-        import _rawffi
+        import _rawffi, platform
+        if platform.machine() == 'x86_64':
+            skip("Segfaults on x86_64 because small structures "
+                 "may be passed in registers and "
+                 "c_elements must not be null")
+
         X_Y = _rawffi.Structure([('x', 'l'), ('y', 'l')])
         x_y = X_Y()
         lib = _rawffi.CDLL(self.lib_name)
@@ -747,7 +752,12 @@
         x_y.free()
 
     def test_ret_struct(self):
-        import _rawffi
+        import _rawffi, platform
+        if platform.machine() == 'x86_64':
+            skip("Segfaults on x86_64 because small structures "
+                 "may be passed in registers and "
+                 "c_elements must not be null")
+
         S2H = _rawffi.Structure([('x', 'h'), ('y', 'h')])
         s2h = S2H()
         lib = _rawffi.CDLL(self.lib_name)

Modified: pypy/trunk/pypy/rlib/test/test_libffi.py
==============================================================================
--- pypy/trunk/pypy/rlib/test/test_libffi.py	(original)
+++ pypy/trunk/pypy/rlib/test/test_libffi.py	Tue Feb 10 18:05:18 2009
@@ -241,6 +241,11 @@
         lltype.free(tp, flavor='raw')
 
     def test_struct_by_val(self):
+        import platform
+        if platform.machine() == 'x86_64':
+            py.test.skip("Segfaults on x86_64 because small structures "
+                         "may be passed in registers and "
+                         "c_elements must not be null")
         from pypy.translator.tool.cbuild import ExternalCompilationInfo
         from pypy.translator.platform import platform
         from pypy.tool.udir import udir
@@ -292,6 +297,11 @@
         assert not ALLOCATED
 
     def test_ret_struct_val(self):
+        import platform
+        if platform.machine() == 'x86_64':
+            py.test.skip("Segfaults on x86_64 because small structures "
+                         "may be passed in registers and "
+                         "c_elements must not be null")
         from pypy.translator.tool.cbuild import ExternalCompilationInfo
         from pypy.translator.platform import platform
         from pypy.tool.udir import udir



More information about the Pypy-commit mailing list