Yep, recompiled with the Ubuntu cross-compiling VM and am getting the same results on my Drobo FS:
./python -v -c ‘import ctypes._endian’
installing zipimport hook
import zipimport # builtin
installed zipimport hook
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/site.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/site.py
import site # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/site.pyc
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/os.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/os.py
import os # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/os.pyc
import errno # builtin
import posix # builtin
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/posixpath.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/posixpath.py
import posixpath # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/posixpath.pyc
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/stat.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/stat.py
import stat # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/stat.pyc
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/genericpath.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/genericpath.py
import genericpath # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/genericpath.pyc
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/warnings.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/warnings.py
import warnings # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/warnings.pyc
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/linecache.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/linecache.py
import linecache # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/linecache.pyc
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/types.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/types.py
import types # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/types.pyc
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/UserDict.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/UserDict.py
import UserDict # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/UserDict.pyc
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/_abcoll.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/_abcoll.py
import _abcoll # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/_abcoll.pyc
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/abc.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/abc.py
import abc # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/abc.pyc
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/_weakrefset.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/_weakrefset.py
import _weakrefset # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/_weakrefset.pyc
import _weakref # builtin
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/copy_reg.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/copy_reg.py
import copy_reg # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/copy_reg.pyc
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/traceback.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/traceback.py
import traceback # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/traceback.pyc
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/sysconfig.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/sysconfig.py
import sysconfig # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/sysconfig.pyc
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/re.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/re.py
import re # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/re.pyc
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/sre_compile.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/sre_compile.py
import sre_compile # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/sre_compile.pyc
import _sre # builtin
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/sre_parse.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/sre_parse.py
import sre_parse # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/sre_parse.pyc
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/sre_constants.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/sre_constants.py
import sre_constants # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/sre_constants.pyc
import encodings # directory /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/encodings
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/encodings/init.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/encodings/init.py
import encodings # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/encodings/init.pyc
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/codecs.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/codecs.py
import codecs # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/codecs.pyc
import _codecs # builtin
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/encodings/aliases.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/encodings/aliases.py
import encodings.aliases # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/encodings/aliases.pyc
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/encodings/ascii.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/encodings/ascii.py
import encodings.ascii # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/encodings/ascii.pyc
Python 2.7.3 (default, Oct 29 2012, 00:21:27)
[GCC 4.2.0 20070413 (prerelease)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
import ctypes # directory /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/ctypes
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/ctypes/init.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/ctypes/init.py
import ctypes # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/ctypes/init.pyc
dlopen("/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/lib-dynload/_ctypes.so", 2);
import _ctypes # dynamically loaded from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/lib-dynload/_ctypes.so
/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/struct.pyc matches /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/struct.py
import struct # precompiled from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/struct.pyc
dlopen("/mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/lib-dynload/_struct.so", 2);
import _struct # dynamically loaded from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/lib-dynload/_struct.so
import ctypes._endian # from /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/ctypes/_endian.py
wrote /mnt/DroboFS/Shares/DroboApps/py2/lib/python2.7/ctypes/_endian.pyc
Aborted
Where do we look next?
interesting:
python -c ‘import ctypes’
Aborted
edit: aha http://whocares.de/finally-a-fix-for-python-2-7-aborts-on-import-of-ctypes/ patching…
EDIT: CONFIRMED! That patch works. Well, not that patch exactly – it didn’t apply for me from his patch file – but the same idea.
[code]±-- a/Modules/_ctypes/libffi/src/closures.c 2012-04-10 01:07:33.000000000 +0200
++++ b/Modules/_ctpyes/libffi/src/closures.c 2012-06-20 17:35:40.277850045 +0200
+@@ -119,52 +119,7 @@
-
#define LACKS_SYS_MMAN_H 1
-
-
#if FFI_MMAP_EXEC_SELINUX
±#include <sys/statfs.h>
±#include <stdlib.h>
±
±static int selinux_enabled = -1;
±
±static int
±selinux_enabled_check (void)
±{
± struct statfs sfs;
± FILE *f;
± char *buf = NULL;
± size_t len = 0;
±
± if (statfs ("/selinux", &sfs) >= 0
± && (unsigned int) sfs.f_type == 0xf97cff8cU)
± return 1;
± f = fopen ("/proc/mounts", “r”);
± if (f == NULL)
± return 0;
± while (getline (&buf, &len, f) >= 0)
± {
± char *p = strchr (buf, ’ ');
± if (p == NULL)
± break;
± p = strchr (p + 1, ’ ');
± if (p == NULL)
± break;
± if (strncmp (p + 1, "selinuxfs ", 10) != 0)
± {
± free (buf);
± fclose (f);
± return 1;
± }
± }
± free (buf);
± fclose (f);
± return 0;
±}
±
±#define is_selinux_enabled() (selinux_enabled >= 0 ? selinux_enabled
± : (selinux_enabled = selinux_enabled_check ()))
±
±#else
±
-
#define is_selinux_enabled() 0
±
-
#endif /* !FFI_MMAP_EXEC_SELINUX */[/code]