Here's the setting:
- Django (1.2) application for mod_wsgi that imports ctypes
- Python 2.6.5
- Apache 2.2.3
- SELinux is disabled
- Redhat EL 5 64bit
- part of the file system is mounted on top of nfs
Sometimes, when I restart apache, I get an import error when trying to import ctypes. Each incoming request fails with error 500. If I restart apache, usually everything starts working again.
Here's the error stack trace:
Traceback (most recent call last): File "/home/appfirst/django/django/core/handlers/base.py", line 80, in get_response response = middleware_method(request) -------------- A BUNCH OF DJANGO MIDDLEWARE STUFF HERE ------------- File "/home/appfirst/django/django/utils/importlib.py", line 35, in import_module __import__(name) File "/home/appfirst/backend/backend/streamer/views.py", line 6, in <module> import appfirst.main.models as FEmodels File "/home/appfirst/frontend/appfirst/main/models.py", line 27, in <module> import numpy, math, mpmath File "/usr/lib64/python2.6/site-packages/numpy/__init__.py", line 43, in <module> import ctypeslib File "/usr/lib64/python2.6/site-packages/numpy/ctypeslib.py", line 9, in <module> import ctypes File "/usr/lib64/python2.6/ctypes/__init__.py", line 546, in <module> CFUNCTYPE(c_int)(lambda: None) MemoryError
I thought that this could be due to this error, but I have SELinux turned off, which I thought would mean that this case can never happen:
Any suggestions on how to reproduce it sequentially and / or fix it? It really shocks me!
source share