2008/10/19 Clodoaldo Pinto Neto <[EMAIL PROTECTED]>:
>
> 2008/10/18 Prunikov <[EMAIL PROTECTED]>:
>>
>> Yeah, without mod_php it works fine. Let me know which information I
>> can give you to find the source of the problem.
>
> While Graham does not come back try to find something in this thread:
>
> http://groups.google.com/group/modwsgi/browse_thread/thread/e717c65de9ed0ad4#

That other case didn't involve PHP, so not really related if disabling
PHP solves the problem.

There are some known conflicts between PHP, Python and Apache in
respect of shared libraries, but I couldn't actually find the example
I thought I had seen of urllib2 causing an issue.

On Python 2.5, if I calculate what new modules urllib2 imports I get:

mimetools <module 'mimetools' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/mimetools.pyc'>
cStringIO <module 'cStringIO' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/cStringIO.so'>
_bisect <module '_bisect' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/_bisect.so'>
_socket <module '_socket' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/_socket.so'>
sre_compile <module 'sre_compile' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/sre_compile.pyc'>
_sha512 <module '_sha512' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/_sha512.so'>
_hashlib <module '_hashlib' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/_hashlib.so'>
_sre <module '_sre' (built-in)>
_ssl <module '_ssl' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/_ssl.so'>
httplib <module 'httplib' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/httplib.pyc'>
rfc822 <module 'rfc822' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/rfc822.pyc'>
urlparse <module 'urlparse' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/urlparse.pyc'>
_random <module '_random' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/_random.so'>
_sha256 <module '_sha256' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/_sha256.so'>
tempfile <module 'tempfile' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/tempfile.pyc'>
base64 <module 'base64' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/base64.pyc'>
binascii <module 'binascii' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/binascii.so'>
urllib <module 'urllib' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib.pyc'>
sre_constants <module 'sre_constants' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/sre_constants.pyc'>
re <module 're' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/re.pyc'>
_struct <module '_struct' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/_struct.so'>
math <module 'math' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/math.so'>
fcntl <module 'fcntl' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/fcntl.so'>
string <module 'string' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/string.pyc'>
urllib2 <module 'urllib2' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.pyc'>
struct <module 'struct' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/struct.pyc'>
hashlib <module 'hashlib' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/hashlib.pyc'>
socket <module 'socket' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/socket.pyc'>
thread <module 'thread' (built-in)>
bisect <module 'bisect' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/bisect.pyc'>
strop <module 'strop' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/strop.so'>
random <module 'random' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/random.pyc'>
time <module 'time' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/time.so'>
sre_parse <module 'sre_parse' from
'/usr/local/python-2.5.2/frameworks/Python.framework/Versions/2.5/lib/python2.5/sre_parse.pyc'>

The important ones to look at here are those from lib-dynload as they
are the C extension modules.

Of note, the SSL and crypto modules get imported and this may a cause
of the problems as conflicts between SSL and crypto libraries has been
a problem before.

  
http://code.google.com/p/modwsgi/wiki/ApplicationIssues#SSL_Shared_Library_Conflicts
  
http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Python_MD5_Hash_Module_Conflict

The hash module issue though was specific to Debian Python 2.4, where
they had broken it, thus wouldn't have thought it was cause a problem
again, unless it has again been broken somehow.

You could perhaps narrow it down in respect of hash module problem, by
reenabling PHP but ensuring that PHP mhash module has been disabled.

But then, Python md5 module shouldn't even be getting used with Python
2.5 as has been superseded by hashlib. If there are SSL problems as
described though, it can still attempt to load md5 module, but by
rights that shouldn't exist and would only be able to be found if
somehow you have an ungodly mixing of your Python 2.4 and 2.5
installations. Just to rule this out, you might indicate whether you
have both Python 2.4 and 2.5 installed and whether you have fiddled
with WSGIPythonHome, WSGIPythonPath directives or python-path option
to WSGIDaemonProcess.

That all said, probably the easiest way of working out why it crashes,
if due to a shared library conflict, is to find out exactly where it
crashes, by using procedure detailed in:

  
http://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Debugging_Crashes_With_GDB

Use Apache single process mode, or attaching to daemon by PID,
whatever is more convenient. Make request and then use 'thread apply
all bt' to work out what threads were doing at point crash occurs.

Graham

> Regards, Clodoaldo
>
>> On Oct 18, 12:50 am, "Graham Dumpleton" <[EMAIL PROTECTED]>
>> wrote:
>>> 2008/10/18 Prunikov <[EMAIL PROTECTED]>:
>>>
>>>
>>>
>>>
>>>
>>> > Simple example.
>>>
>>> > def application(environ, start_response):
>>> >    source = 'source'
>>>
>>> >    import urllib2
>>> >    url = 'http://www.google.com/'
>>> >    urllib2.urlopen(url)
>>>
>>> >    response_headers = [('Content-type', 'text/html'),
>>> >                        ('Content-Length', str(len(source)))]
>>>
>>> >    start_response('200 OK', response_headers)
>>> >    return [source]
>>>
>>> > got this in error.log
>>>
>>> > [Fri Oct 17 23:38:22 2008] [error] [client 127.0.0.1] Premature end of
>>> > script headers: application-d.wsgi.py
>>>
>>> > ----------------------
>>> > SERVER_SOFTWARE ::: Apache/2.2.9 (Unix) mod_fastcgi/2.4.2 mod_ssl/
>>> > 2.2.9 OpenSSL/0.9.7l DAV/2 PHP/5.2.6 mod_wsgi/2.0 Python/2.5.1
>>>
>>> If you disable PHP module in Apache, do you see the same problem.
>>>
>>> Vaguely remember some shared library versioning issue between PHP and
>>> mod_wsgi/Python causing urllib to crash.
>>>
>>> Will need to see if I can find any reference to it.
>>>
>>> Graham
>> >
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to