http://arm.koji.fedoraproject.org/koji/taskinfo?taskID=2825638 ---------------------------------------------------------------------- Ran 39 tests in 3.240s OK 360 tests OK. 1 test failed: test_ctypes 39 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_curses test_dl test_gdb test_gl test_imgfile test_ioctl test_kqueue test_linuxaudiodev test_macos test_macostools test_msilib test_ossaudiodev test_pep277 test_scriptpackages test_smtpnet test_socketserver test_startfile test_sunaudiodev test_timeout test_tk test_ttk_guionly test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 2 skips unexpected on linux2: test_gdb test_ioctl [1337952 refs]
Any update Robert? This is now blocking all aarch64 builds
I've tried to work on this before Christmas but I didn't get access to aarch64 machine with fedora image. I tried to contact several people (also #arm) without success. Any ideas?
(In reply to Robert Kuska from comment #2) > I've tried to work on this before Christmas but I didn't get access to > aarch64 machine with fedora image. I tried to contact several people (also > #arm) without success. Any ideas? You didn't ask here or on #fedora-arm. Did you try beaker? There's aarch64 machines in there too
The error appears to be: ====================================================================== FAIL: test_struct_by_value (ctypes.test.test_win32.Structures) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Python-2.7.9/Lib/ctypes/test/test_win32.py", line 112, in test_struct_by_value self.assertEqual(ret.left, left.value) AssertionError: -200 != 10 ---------------------------------------------------------------------- Ran 438 tests in 1.894s FAILED (failures=1, skipped=89)
Notes: (A) every other suite within test_win32.py is wrapped with: @unittest.skipUnless(sys.platform == "win32", 'Windows-specific test') (B) the failing test is calling into _ctypes_test module, which is built from Python-2.7.9/Modules/_ctypes/_ctypes_test.c
Notes: the function is question has signature: RECT ReturnRect(int i, RECT ar, RECT* br, POINT cp, RECT dr, RECT *er, POINT fp, RECT gr); where: typedef struct { long x; long y; } POINT; typedef struct { long left; long top; long right; long bottom; } RECT; mstuchli reports that gdb reports: (gdb) print sizeof(long) 8 (gdb) print sizeof(RECT) 32
Note: The direct cause of ReturnRect returning the incorrect value is that POINT fp is {x = 4396722784816, y = 5773424} while is should be equal to {x = 15, y = 25}.
ctypes test committer here. While this test is in the test_win32.py file, all platforms should successfully pass it, the failure would seem to indicate a possible problem with libffi and arm64. I constructed the test to overload the stack-heap argument passing mechanism on win64, does arm64 have a similar issue?
Yes, it looks like the stack is corrupted. Also http://bugs.python.org/issue11835 looks similiar but it's arm64 specific. I have tried to rebuild python with the latest (upstream released) libffi but it didn't help.
Note: I have just finished python build with bundled libffi with the same result.
cc libffi maintainer Anthony, would it be possible for you to help with debugging this issue?
Created attachment 979569 [details] some check Something is weird. Applied that patch on x86-64: ------------------------------------------------------------------ test test_ctypes produced unexpected output: ********************************************************************** hrw1: 10 20 30 40 ********************************************************************** ------------------------------------------------------------------ But on aarch64: ------------------------------------------------------------------ test_struct_by_value (ctypes.test.test_win32.Structures) ... hrw1: 721554505738 42949672980 85899345950 128849018920 FAIL ------------------------------------------------------------------ Looks like structs are given wrong on aarch64.
Created attachment 979585 [details] fix to get aarch64 a bit further With this patch applied at least values of c_long variables are correct. Now the problem is with ReturnRect() calls.
(In reply to Marcin Juszkiewicz from comment #13) > Created attachment 979585 [details] > fix to get aarch64 a bit further > > With this patch applied at least values of c_long variables are correct. > > Now the problem is with ReturnRect() calls. Which Python are you testing this on, Marcin? The 2.7.9 in Fedora rawhide already includes this patch.
Matej: I played with upstream one as issue existed as well and was easier to hack around.
Heh. I was few commits before during my tests ;(
I can have a quick look at this this afternoon if somebody can point me at an aarch64 box.
Created attachment 979728 [details] Reproducer for libffi testsuite Here's a reproducer. Drop it in libffi's libffi.call testsuite directory and run make check. Passes on x86, but fails on aarch64.
I have renamed the attachment as python_ctypes.c. make check output: FAIL: libffi.call/python_ctypes.c -W -Wall -Wno-psabi -O0 execution test FAIL: libffi.call/python_ctypes.c -W -Wall -Wno-psabi -O2 execution test FAIL: libffi.call/python_ctypes.c -W -Wall -Wno-psabi -O3 execution test FAIL: libffi.call/python_ctypes.c -W -Wall -Wno-psabi -Os execution test FAIL: libffi.call/python_ctypes.c -W -Wall -Wno-psabi -O2 -fomit-frame-pointer execution test Great, thank you for your help. I am changing the component to libffi (hope you don't mind).
Created attachment 980183 [details] libffi fix For any 1-16 byte structure not passed in registers, we weren't copying from the object to be passed, but from the array of objects. To obvious ill effect.
Patch added and built on rawhide (both mainline and aarch64), testing python build now